how to scroll the tabs in tabview

你说的曾经没有我的故事 提交于 2019-12-10 15:26:35

问题


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


回答1:


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




回答2:


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>


来源:https://stackoverflow.com/questions/3853760/how-to-scroll-the-tabs-in-tabview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!