【发布时间】:2016-09-25 15:28:18
【问题描述】:
在下面的布局文件中,对于最后一个线性布局,我添加了三个带有有效图像和文本的图像按钮。但是,它们根本不会显示在应用程序中。下面给出了这个的布局文件。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="120dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/female_default"
android:layout_gravity="center_horizontal"
android:id="@+id/imageView2"
android:layout_weight="1" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:text="TextView"
android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView3" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:text="TextView"
android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView2" />
<TextView
android:id="@+id/id"
android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="Balle"
android:textAppearance="?attr/textAppearanceListItem" />
<TextView
android:id="@+id/content"
android:layout_gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="Shaaba"
android:textAppearance="?attr/textAppearanceListItem" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="100dp">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:srcCompat="@android:drawable/ic_menu_edit"
android:id="@+id/imageButton4"
android:layout_weight=".25" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:srcCompat="@android:drawable/ic_menu_delete"
android:id="@+id/imageButton3"
android:layout_weight=".25" />
<Button
android:text="@string/mark_as_default"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/button"
android:layout_weight=".5" />
</LinearLayout>
</LinearLayout>
【问题讨论】:
标签: android android-layout android-recyclerview