如何创建这样的 gridview 列表项
How to create gridview list item like that
我如何创建这个带有一些文本的黑色容器,就像这张照片上的一样?
试试这个:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="150dp"
android:layout_height="150dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="150dp"
android:layout_height="150dp"
android:background="#aaee00"/>
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="#55000000"
android:gravity="center"
android:text="Dummy text"
android:textColor="#eeffffff"/>
</RelativeLayout>
希望对您有所帮助。
我如何创建这个带有一些文本的黑色容器,就像这张照片上的一样?
试试这个:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="150dp"
android:layout_height="150dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="150dp"
android:layout_height="150dp"
android:background="#aaee00"/>
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="#55000000"
android:gravity="center"
android:text="Dummy text"
android:textColor="#eeffffff"/>
</RelativeLayout>
希望对您有所帮助。