Skip to content

Instantly share code, notes, and snippets.

@tateisu
Created October 28, 2021 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tateisu/b690bcdf558f5b34ef625b30e0d0e3cd to your computer and use it in GitHub Desktop.
Save tateisu/b690bcdf558f5b34ef625b30e0d0e3cd to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
tools:context=".MainActivity">
<!-- ImageButton はデフォルトの背景(とパディング) があるが、この例はパディングを上書きする -->
<ImageButton
android:layout_width="24dp"
android:layout_height="24dp"
android:importantForAccessibility="no"
android:padding="4dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_android"
app:tint="?android:attr/textColor" />
<ImageButton
android:layout_width="48dp"
android:layout_height="48dp"
android:importantForAccessibility="no"
android:padding="12dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_android"
app:tint="?android:attr/textColor" />
<ImageButton
android:layout_width="96dp"
android:layout_height="96dp"
android:importantForAccessibility="no"
android:padding="12dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_android"
app:tint="#FF8000" />
<ImageButton
android:layout_width="144dp"
android:layout_height="144dp"
android:importantForAccessibility="no"
android:padding="12dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_android"
app:tint="#0080ff" />
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment