Так вот как это выглядит прямо сейчас.
![enter image description here](https://i.stack.imgur.com/tRblJ.png)
с кодом XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<TextView
style="?android:listSeparatorTextViewStyle"
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="@string/crime_title_label" />
<EditText
android:id="@+id/crime_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:hint="@string/crime_title_hint" />
<TextView
style="?android:listSeparatorTextViewStyle"
android:id="@+id/crime_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/crime_title"
android:text="@string/crime_details_label" />
<Button
android:id="@+id/crime_date"
android:layout_below="@+id/crime_details"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/crime_solved"
android:layout_below="@+id/crime_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/crime_solved_label" />
<Button
android:id="@+id/suspect_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/crime_solved"
android:text="@string/choose_suspect" />
<Button
android:id="@+id/send_crime_report"
android:text="@string/send_crime_report"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/suspect_button" />
<ImageView
android:id="@+id/callImage"
android:layout_width="57dp"
android:layout_height="wrap_content"
android:layout_below="@id/crime_solved"
android:layout_alignBottom="@+id/suspect_button"
android:layout_toRightOf="@id/suspect_button"
app:srcCompat="@android:drawable/sym_action_call" />
</RelativeLayout>
То, что я хочу сделать, этоИмейте ImageView callImage
справа от suspect_button
и в самой правой стороне в целом.Для этого я хочу, чтобы suspect_button
был максимально расширен, как вы делаете в match_parent
.Но когда я делаю match_parent
, ImageView теряется.Проще говоря, я хочу "match_parent
" suspect_button
, но при этом мой ImageView callImage
находится на правой стороне suspect_button
, при этом не теряясь во внешнем виде.
Буду признателен, если вы не предложите решения, требующие использования другого макета.Я хочу узнать, возможно ли это, или как сделать то, что я представляю, чтобы сделать в Relative Layout.
Спасибо.