Я хочу создать макет на основе следующего изображения:
, так как это свидетельство того, что у меня есть CardView, который я показываю красным линии и вид карты в LinearLayout, и у меня есть изображение в виде карты, в котором я хочу показать его немного в линейном макете.
Я использую следующий код для создания макета,
<?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"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grayBack"
android:orientation="vertical"
tools:context=".activities_v2.customer_steps.CustomerStepOne">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/md_white_1000"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginEnd="@dimen/_10sdp"
android:layout_marginRight="@dimen/_10sdp"
android:textColor="@color/editText"
android:textSize="@dimen/_14ssp"
/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_20sdp"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginTop="@dimen/_100sdp"
android:layout_marginEnd="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginBottom="@dimen/_10sdp"
android:minHeight="@dimen/_50sdp"
card_view:cardCornerRadius="@dimen/_10sdp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="236dp"
android:layout_height="@dimen/_150sdp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:src="@drawable/ic_illustration_02" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/_10sdp"
android:textColor="@color/editText"
android:textSize="@dimen/_14ssp" />
</LinearLayout>
</android.support.v7.widget.CardView>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/button_background_blue"
android:minWidth="@dimen/_150sdp"
android:textSize="@dimen/_14ssp" />
</LinearLayout>