android studioで
imagebuttonの横幅を画面幅の0.8倍の大きさにしたいです。
iOSでいうところのViewとimagebuttonのEqual with → multiplier=0.8です。
できればxmlの方で可能な方法はありますでしょうか。
よろしくお願いします。
現XML
<?xml version="1.0" encoding="utf-8"?><android.support.constraint.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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Machiuke">
<ImageButton android:id="@+id/buttonA" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" android:adjustViewBounds="true" android:background="@null" android:scaleType="fitXY" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/buttonA" tools:ignore="MissingConstraints" tools:layout_editor_absoluteX="0dp" />
</android.support.constraint.ConstraintLayout>
回答1件
あなたの回答
tips
プレビュー