Horizontal scroll view and tabs issues

1,057 views
Skip to first unread message

brandall

unread,
Apr 18, 2012, 1:59:50 PM4/18/12
to actionba...@googlegroups.com
I'm using ActionBarSherlock (currently 4.0.2) for the alpha release of my application utter!

The application uses a tab layout with the snippet of xml as follows:

       <HorizontalScrollView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:fillViewport="true"
            android:scrollbars="none" >

            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                android:orientation="horizontal" />
        </HorizontalScrollView>

This works fine for me on all of my devices and the emulator - the multiple tabs are well spaced and scrollable. However, users have reported on XDA that their tabs are squashed and not scrollable and confined to the width of their display - They've posted screenshots from this page onwards an example of which is above.  

I'm relatively new to Java, so I'm hoping I'm missing something obvious, but I've tried many different permutations without success and as I can't replicate their issues, it's slow progress to try and resolve what's causing this. I've posted how it looks for me above.

I hope someone can shed some light and it turns out I'm making a very simple mistake... 

Thanks Jake for your work on ActionBarSherlock - it's currently the best part of my application!

SimonVT

unread,
Apr 18, 2012, 2:32:35 PM4/18/12
to actionba...@googlegroups.com
TabWidget is not a part of ABS. You'll probably have more luck on either the Android Developer google group, or stackoverflow.

brandall

unread,
Apr 18, 2012, 2:55:22 PM4/18/12
to actionba...@googlegroups.com
Thanks Simon,

The reason I post here first is because as a basis I'm using Sherlock Fragment Tabs and the associated TabHost layout - I hoped other users may have already addressed this issue when including multiple tabs. Also, this thread led me to believe I was missing something that had been implement from V4 onwards.

If no joy here, then I'll head over to Stackoverflow, which is where I currently spend most of my life!

SimonVT

unread,
Apr 18, 2012, 3:12:44 PM4/18/12
to actionba...@googlegroups.com
Those samples are from the support library, they're simply updated to use Sherlock* classes.
The ActionBar has its own tab implementation. There's also ViewPagerIndicator (the pattern used for tab indicators in e.g. play store). Alternatively you can make your own tab bar.

brandall

unread,
Apr 18, 2012, 3:23:50 PM4/18/12
to actionba...@googlegroups.com
Ok, I'm with you now, thanks.

Being relatively new to Java, I was really hoping it was a simple xml oversight on my part - The other options I've tried (ViewPagerIndicator) have caused me more headaches for different reasons...

I've already searched other groups and Stackoverflow for a similar issue, but no luck :(
Reply all
Reply to author
Forward
0 new messages