在 RelativeLayout 中有一个 button, textview 和一个 EditText按序排列。我想隐藏button 和 textview ,但是仍然保持 EditText 在布局中的位置不变。我使用android:visibility:gone
但是还是不能运行。如何实现?
<Button
android:id="@+id/exit"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBottom="@+id/title"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/title"
android:background="@color/red" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/exit"
android:text="@string/name" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/message"
android:focusable="true"
android:inputType="textMultiLine"
android:maxLines="1" >