如何设置android Horizo​​ntalScrollView从右到左的行为(默认选中的选项卡从右侧,而不是左侧)

如何设置Horizo​​ntalScrollView以从右向左的方式运行?
认行为是显示的第一个选项卡(认选项卡)来自左侧.
我希望选项卡反向排序,以便第一个认”选项卡位于屏幕的右侧.

我怎么做?
我使用layout_gravity但它不起作用..

这是我的布局代码,包含tabhost和Horizo​​ntalScrollView:

<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性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...