CSS中的“float:right”属性在LinearLayout中相当于android?

在CSS上我们可以写:
<div style="float:right"> Text1 </div>
<div style="float:right"> Text2 </div>

通过这种方式Text1将出现在右边..

我试图对LinearLayout做同样的事情,View应该从右到左显示

<LinearLayout android:id="@+id/linearLayout1" android:layout_gravity="right" android:gravity="right"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:layout_weight="1" android:weightSum="2" android:orientation="horizontal">
        <!-- First Column should be on the right : Text1-->
        <LinearLayout android:id="@+id/linearLayout2"
            android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="right" android:gravity="right"
            android:layout_weight="1">...</LinearLayout>
        <!-- Second Column should be on the left : Text2 -->
        <LinearLayout android:id="@+id/linearLayout3"
            android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="right" android:gravity="right"
            android:layout_weight="1">...</LinearLayout>
</LinearLayout>

谢谢

解决方法

这可能是
<LinearLayout android:id="@+id/linearLayout1"
    android:gravity="right"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:weightSum="2"
    android:orientation="horizontal"
    android:layout_gravity="right"
    >
    <!-- Second Column should be on the left : Text2 -->
    <LinearLayout android:id="@+id/linearLayout3"
        android:layout_width="wrap_content" android:layout_height="fill_parent" 
        android:layout_weight="1">...</LinearLayout>
    <!-- First Column should be on the right : Text1-->
    <LinearLayout android:id="@+id/linearLayout2"
        android:layout_width="wrap_content" android:layout_height="fill_parent"
        android:layout_weight="1">...</LinearLayout>

相关文章

Css3如何实现鼠标移上变长特效?(图文+视频)
css3怎么实现鼠标悬停图片时缓慢变大效果?(图文+视频)
jquery如何实现点击网页回到顶部效果?(图文+视频)
css3边框阴影效果怎么做?(图文+视频)
css怎么实现圆角边框和圆形效果?(图文+视频教程)
Css3如何实现旋转移动动画特效