Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created December 21, 2023 13:47
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 codeforfun-jp/4ba5b448e2ecf3758629096a0d82df37 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/4ba5b448e2ecf3758629096a0d82df37 to your computer and use it in GitHub Desktop.
Android Studio AlertDialog with ImageView
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/holo_orange_light"
android:gravity="center"
android:padding="16dp"
android:text="タイトル"
android:textSize="20sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:contentDescription="image"
android:src="@android:drawable/sym_def_app_icon" />
<TextView
android:id="@+id/image_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="画像名"
android:textAlignment="center"
android:textSize="16sp" />
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="メッセージ" />
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment