开发者

how to scroll the tabs in tabview

开发者 https://www.devze.com 2023-01-18 11:16 出处:网络
I am using six tabs in tab view. In portrait mode tab size become very 开发者_Go百科small .So i want to scroll the tabs in horizontal so that size of each tab will remain original . How we can do this

I am using six tabs in tab view. In portrait mode tab size become very 开发者_Go百科small .So i want to scroll the tabs in horizontal so that size of each tab will remain original . How we can do this?


Is this what you are looking for? http://blog.uncommons.org/2011/04/18/scrolling-tabs-in-android/


There are a lot of solutions on the web for this but they're all complicated and unnecessary. If you are trying to make the tabs on the top of the screen scroll-able then you can use this simple implementation I have shown below. Hope this helps.

<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="fill_parent"
        android:layout_height="wrap_content" />

</HorizontalScrollView>
0

精彩评论

暂无评论...
验证码 换一张
取 消