
默认行为是显示的第一个选项卡(默认选项卡)来自左侧.
我希望选项卡反向排序,以便第一个“默认”选项卡位于屏幕的右侧.
我怎么做?
我使用layout_gravity但它不起作用..
这是我的布局代码,包含tabhost和HorizontalScrollVIEw:
<TabHost xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:ID="@androID:ID/tabhost"androID:layout_wIDth="fill_parent"androID:layout_height="fill_parent" ><linearLayout androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:orIEntation="vertical" > <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> <FrameLayout androID:ID="@androID:ID/tabcontent" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" /></linearLayout></TabHost>解决方法 一个有效的解决方法:
final horizontalscrollview vIEw = (horizontalscrollview) findVIEwByID(R.ID.scroller); vIEw.postDelayed(new Runnable() { @OverrIDe public voID run() { vIEw.fullScroll(horizontalscrollview.FOCUS_RIGHT); } },10); 这个想法是程序化滚动需要延迟才能工作.
总结以上是内存溢出为你收集整理的如何设置android HorizontalScrollView从右到左的行为(默认选中的选项卡从右侧,而不是左侧)全部内容,希望文章能够帮你解决如何设置android HorizontalScrollView从右到左的行为(默认选中的选项卡从右侧,而不是左侧)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)