В андроиде, как установить изображение в верхнем левом и правом верхнем углу карты? - PullRequest
0 голосов
/ 08 сентября 2018

Нажмите, чтобы открыть изображение, как это

Я поставил изображение, которое мне нравится, используя cardview, поэтому, пожалуйста, ответьте сюда.

Ответы [ 2 ]

0 голосов
/ 08 сентября 2018
**Use code like below and you will achieve it** 


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical">
    <android.support.v7.widget.CardView
        android:id="@+id/card_view_notification"
        android:layout_gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        card_view:cardCornerRadius="20dp"
        card_view:contentPadding="7dp">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">


            <ImageView
                android:id="@+id/iconLead"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@drawable/logo" />
        </LinearLayout>
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/iconLead1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:src="@drawable/logo1" />
        <ImageView
            android:id="@+id/iconLead2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:src="@drawable/logo2" />
        <ImageView
            android:id="@+id/iconLead3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="end"
            android:src="@drawable/log3o" />


</LinearLayout>
    </android.support.v7.widget.CardView>
</LinearLayout>
0 голосов
/ 08 сентября 2018

Вы можете использовать card_view:cardCornerRadius

Например:

<android.support.v7.widget.CardView
    android:id="@+id/card_view_inner"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:layout_gravity="center"
    card_view:cardCornerRadius="10dp"
    card_view:cardElevation="0dp" >
</android.support.v7.widget.CardView>

Для получения дополнительной информации, пожалуйста, обратитесь к этому CardView

...