私は次のRelativeLayoutを持っています
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp">
<TextView
android:id="@+id/x_memtxtlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/x_memamtlay"
android:textColor="#000000"
android:textSize="22sp"
android:paddingLeft="3dp">
</TextView>
<EditText
android:id="@+id/x_memamtlay"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_width="70dp"
android:inputType="number"
android:singleLine="true"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:background="@drawable/edittext_greybg"
android:visibility="gone">
</EditText>
<TextView
android:id="@+id/x_memamt"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="#000000"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:textSize="20sp"
android:background="@drawable/number_fill">
</TextView>
</RelativeLayout>
ここで、いくつかの要件に基づいて、アクティビティでEditText(@ + id / x_memamtlay)の可視性をgoing / visibleに設定し、2番目のTextView(@ + id / x_memamt)の可視性をgoing/visibleに定期的に設定する必要があります。時間。
問題は、1番目のTextView(@ + id / x_memtxtlay)で、
android:layout_toLeftOf = "@ + id /x_memamtlay"を設定したとき:(EditTextの左側)
しかし、android:layout_toLeftOf = "@ + id / x_memamt"を設定すると:(2番目のTextViewの左側に)
1番目のTextViewがEditTextと2番目のTextViewの両方に左揃えになるようにレイアウトを調整するにはどうすればよいですか。