これが私のレイアウトコードです
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center"
android:layout_margin="5dp"
android:id="@+id/main_dash_baord_lay">
<android.support.v7.widget.CardView
android:id="@+id/dash_board_car.d_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<ImageView
android:id="@+id/dash_board_image"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_gravity="center"
android:background="@drawable/defgall"
android:scaleType="fitXY" />
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:id="@+id/dash_board_text"
android:hint="Name"
android:padding="5dp"
android:textColor="@color/dark_slate_blue"
android:textStyle="bold" />
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
画像1にはアルファと透明の背景が含まれていますが、使用するかどうかはわかりません。
これを試して
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/dash_board_car.d_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/dash_board_image"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_gravity="center"
android:background="@drawable/nilesh"
android:scaleType="fitXY" />
<TextView
android:id="@+id/dash_board_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:hint="Name"
android:text="Nilesh Rathod"
android:padding="5dp"
android:drawableBottom="@drawable/ic_marker"
android:background="#82000000"
android:layout_gravity="bottom"
android:textColor="#FFFFFF"
android:textStyle="bold" />
</FrameLayout>
</android.support.v7.widget.CardView>
出力
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加