在我的LinearLayout中使用与重力结合的重量会导致重量的影响发生逆转。布局:LinearLayout与重力和重量
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="0.2">
<TextView android:id="@+id/feedfragmentTitle" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="8"/>
<TextView android:id="@+id/feedfragmentDate" android:layout_height="wrap_content" android:gravity="right" android:layout_width="fill_parent" android:layout_weight="2"/>
</LinearLayout>
给定的LinearLayout包含一个标题,这应该appromately采取布局的80%和日期+时间与20%。日期+时间应该具有权利的重力。我张贴的布局不起作用,如果我玩参数重量,结果是倒置的。
是否有另一种方式获得结果而不交换权重?
工作正常!但为什么不能解决我的问题?有什么不对吗?或者它只是Android/LinearLayout的行为?我在另一个项目中使用了一个类似的构造,它运行良好。 – kadir
http://stackoverflow.com/questions/5986793/in-android-layouts-what-is-the-effect-meaning-of-layout-height-0dip – blessenm