지하는 방법 작물 이미지 뷰 내부 LinearLayout?

0

질문

안녕하세요,저는 뭔가를 만들려고 노력이

what i want

이것은 무엇을 얻을

enter image description here

이 xml

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="180dp"
        android:layout_height="match_parent"
        android:layout_marginHorizontal="10dp">

    <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/category_item_background"
            android:clickable="true"
            android:focusable="true"
            android:layout_marginTop="50dp"
            android:orientation="vertical"
            android:paddingBottom="20dp">

        <ImageView
                android:id="@+id/planetImage"
                android:layout_marginTop="-50dp"
                android:layout_gravity="center_horizontal"
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:src="@drawable/earth_transparent"
                />

        <TextView
                android:id="@+id/planetName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_marginTop="10dp"
                android:textColor="@color/white"
                android:text="Mars"
                android:fontFamily="@font/assistant_extrabold"
                android:textSize="30dp"/>

        <TextView
                android:id="@+id/planetViews"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:fontFamily="@font/assistant_extrabold"
                android:text="155 views"/>

    </LinearLayout>


</LinearLayout>

의 이미지가 잘하고 나는 방법을 알아낼 수 없습니다 예측하다. 나는에 대해 걱정하지 않는 색상 차이를 바로 지금,나는 그냥을 설정하려면,뭔가지 않도록 작은 이미지입니다.

android android-image crop
2021-11-13 18:58:58
1

최고의 응답

0

그냥 넣어 외부 이미지 뷰

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="180dp"
    android:layout_height="wrap_content"
    android:layout_marginHorizontal="10dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:background="@drawable/category_item_background"
        android:clickable="true"
        android:focusable="true"
        android:orientation="vertical"
        android:paddingBottom="20dp">

        <TextView
            android:id="@+id/planetName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="70dp"
            android:fontFamily="@font/assistant_extrabold"
            android:gravity="center_horizontal"
            android:text="Mars"
            android:textColor="@color/white"
            android:textSize="30dp" />

        <TextView
            android:id="@+id/planetViews"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fontFamily="@font/assistant_extrabold"
            android:gravity="center_horizontal"
            android:text="155 views" />

    </LinearLayout>

    <ImageView
        android:id="@+id/planetImage"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerHorizontal="true"
        android:background="@color/black"
        android:src="@drawable/earth_transparent" />

</RelativeLayout>
2021-11-13 19:09:48

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................