Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created August 2, 2022 10:55
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/f809e7fca6e8556be49579b29327f25f to your computer and use it in GitHub Desktop.
Save codeforfun-jp/f809e7fca6e8556be49579b29327f25f to your computer and use it in GitHub Desktop.
【Java】ListView with imageview and textview 2
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="6dp">
<ImageView
android:id="@+id/image"
android:layout_width="50dp"
android:layout_height="50dp"
tools:src="@tools:sample/avatars"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="動物名"
android:textSize="18sp"
android:layout_marginStart="6dp"
android:layout_marginLeft="6dp"
app:layout_constraintStart_toEndOf="@+id/image"
app:layout_constraintTop_toTopOf="@+id/image" />
<TextView
android:id="@+id/detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="説明文を表示します。"
app:layout_constraintBottom_toBottomOf="@+id/image"
app:layout_constraintStart_toStartOf="@+id/name"
app:layout_constraintTop_toBottomOf="@+id/name" />
</androidx.constraintlayout.widget.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment