所以我正在開發一個有 4 個影像按鈕的應用程式,但由于某種原因,影像非常放大。有什么想法嗎?

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@ id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ImageButton
android:id="@ id/imageButton1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginEnd="520dp"
android:onClick="Click1"
android:src="@drawable/placeholder1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SpeakableTextPresentCheck"
tools:srcCompat="@drawable/placeholder1" />
uj5u.com熱心網友回復:
找到了答案。需要將這些標簽中的任何一個添加到每個按鈕:
android:scaleType="centerInside"
android:scaleType="fitXY"
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/505832.html
