Я хочу создать следующий макет.LinearLayout не работает с RelativeLayout
--------------------------------
Title
Summary Info
[Get Direction][Call][More Info]
--------------------------------
Я кодирую следующую схему, но кнопки не отображаются. Я понятия не имею, почему LinearLayout работает как FrameLayout, поэтому RelativeLayout скрывает кнопки. Я что-то пропустил? Я использую поддержки библиотеки 22,1
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/location_card_height">
<ImageView android:id="@+id/cardImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center"
android:layout_gravity="center" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom" >
<TextView android:id="@+id/title"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:singleLine="true"
android:hint="Title" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/title">
<TextView android:id="@+id/info"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearance"
android:singleLine="true"
android:hint="Info"
android:layout_alignParentRight="true"
android:ellipsize="end" />
<TextView android:id="@+id/summary"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textAppearance="?android:attr/textAppearance"
android:singleLine="true"
android:hint="Summary"
android:layout_toLeftOf="@id/info"
android:ellipsize="end" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/panelAction"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/btnDirection"
android:text="@string/get_direction"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/btnCall"
android:text="@string/label_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/btnMoreInfo"
android:text="@string/more_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
Вы хотите только над Layout? Или вы хотите сделать это только в FrameLayout? –