Я пытаюсь добавить три текстовых вида следующим образом, но я не мог этого достичь. Я хочу, чтобы A был на левой стороне, а два других texviews были правыми.Помещение TextViews в относительный макет
Вот что я получаю:
Вот моя текущая реализация
<RelativeLayout
android:id="@+id/mainlayout"
android:layout_width="match_parent"
android:layout_height="40dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:background="#363636">
<TextView
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="A"
android:textColor="@android:color/white"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:textSize="16sp"
android:fontFamily="sans-serif-medium" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:id="@+id/innerLayout">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:text="B "
android:textSize="16sp"
android:textColor="@android:color/white"
android:paddingRight="8dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:text="C "
android:textSize="16sp"
android:textColor="@android:color/white"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:paddingLeft="8dp"
android:paddingRight="8dp" />
</RelativeLayout>
</RelativeLayout>
Что происходит, что вы не хотите? – buczek
добавить андроид: background = "# FF0000FF" в ваш TextViews, чтобы получить синий фон – MojioMS
Это не про фон, а о местоположении текстовых просмотров неправильно в правильном положении – hotspring