Skip to content

Commit d192eb0

Browse files
committed
一覧画面のLayoutを書く
1 parent 3521e92 commit d192eb0

File tree

2 files changed

+47
-10
lines changed

2 files changed

+47
-10
lines changed
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
43
xmlns:tools="http://schemas.android.com/tools"
54
android:layout_width="match_parent"
65
android:layout_height="match_parent"
76
tools:context=".MainActivity">
87

9-
<TextView
10-
android:layout_width="wrap_content"
8+
<EditText android:id="@+id/edit_text"
9+
android:layout_width="match_parent"
1110
android:layout_height="wrap_content"
12-
android:text="Hello World!"
13-
app:layout_constraintBottom_toBottomOf="parent"
14-
app:layout_constraintLeft_toLeftOf="parent"
15-
app:layout_constraintRight_toRightOf="parent"
16-
app:layout_constraintTop_toTopOf="parent" />
11+
android:layout_alignParentTop="true"
12+
android:hint="Keyword"
13+
android:inputType="text"/>
1714

18-
</androidx.constraintlayout.widget.ConstraintLayout>
15+
<ListView android:id="@+id/list_view"
16+
android:layout_width="match_parent"
17+
android:layout_height="match_parent"
18+
android:layout_alignParentBottom="true"
19+
android:layout_below="@id/edit_text"
20+
tools:listitem="@layout/list_item" />
21+
22+
</RelativeLayout>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="wrap_content"
6+
android:padding="10dp">
7+
8+
<ImageView
9+
android:id="@+id/image_view"
10+
android:layout_width="50dp"
11+
android:layout_height="50dp"
12+
android:layout_marginRight="10dp"/>
13+
14+
<TextView android:id="@+id/item_title"
15+
android:layout_width="wrap_content"
16+
android:layout_height="wrap_content"
17+
android:layout_alignParentTop="true"
18+
android:layout_toRightOf="@id/image_view"
19+
android:ellipsize="end"
20+
android:lines="1"
21+
android:textSize="20sp"
22+
tools:text="item"/>
23+
24+
<TextView android:id="@+id/user_name"
25+
android:layout_width="wrap_content"
26+
android:layout_height="wrap_content"
27+
android:layout_alignParentBottom="true"
28+
android:layout_toRightOf="@id/image_view"
29+
android:ellipsize="end"
30+
android:lines="1"
31+
tools:text="user"/>
32+
33+
</RelativeLayout>

0 commit comments

Comments
 (0)