0

I'm customing my own dialogBox:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/text" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:textSize="16sp" android:layout_marginTop="4dp" android:layout_marginLeft="4dp" android:layout_marginRight="4dp" android:layout_marginBottom="4dp" android:hint="@string/pull"/> <ImageView android:src="@drawable/tira_cable" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="center"/> </LinearLayout> 

The screen width is 700 and the image width is 600 but it is not shown correctly:

enter image description here

And the image is:

enter image description here

How should I do it?

2 Answers 2

1

Try to change scaletype ex: scaleType="fitXY"

<ImageView android:src="@drawable/tira_cable" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="fitXY"/> 
Sign up to request clarification or add additional context in comments.

Comments

1
<ImageView android:src="@drawable/tira_cable" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="centerCrop"/> 

probably the scaleType you need is "centerCrop"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.