我有以下代码:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/editText1"
android:layout_width="0dp"
android:layout_height="150dp"
android:layout_weight="3"
android:inputType="textMultiLine" >
</EditText>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_weight="1"
android:text="@string/new_post_txt_description" />
</LinearLayout>
显然android:layout_gravity="top"
不会向上移动TextView
。任何人都知道如何实现这一目标?
附言
我看到了一些关于 using 的想法RelativeLayout
,但在我的情况下,我需要两个控件彼此相邻并使用 weight 属性,如示例中所示。
谢谢!