質問編集履歴

1

コードの追記

2019/02/28 08:37

投稿

hodoru3sei
hodoru3sei

スコア284

test CHANGED
File without changes
test CHANGED
@@ -8,30 +8,50 @@
8
8
 
9
9
  ```XML
10
10
 
11
- <android.support.design.widget.CoordinatorLayout
11
+ <?xml version="1.0" encoding="utf-8"?>
12
12
 
13
- xmlns:android="http://schemas.android.com/apk/res/android"
13
+ <android.support.constraint.ConstraintLayout
14
14
 
15
- xmlns:tools="http://schemas.android.com/tools"
15
+ xmlns:android="http://schemas.android.com/apk/res/android"
16
16
 
17
- android:layout_width="match_parent"
17
+ xmlns:tools="http://schemas.android.com/tools"
18
18
 
19
- android:layout_height="match_parent"
20
-
21
- android:background="@color/colorC6"
22
-
23
- tools:context=".presentation.presenter.Hoge.HogeActivity">
19
+ xmlns:app="http://schemas.android.com/apk/res-auto"
24
-
25
- <ListView
26
-
27
- android:id="@+id/infomation_list"
28
20
 
29
21
  android:layout_width="match_parent"
30
22
 
31
23
  android:layout_height="match_parent"
32
24
 
33
- />
25
+ tools:context=".MainActivity">
34
26
 
27
+ <ListView
28
+
29
+ android:id="@+id/list_view"
30
+
31
+ android:layout_width="395dp"
32
+
33
+ android:layout_height="715dp" app:layout_constraintTop_toTopOf="parent"
34
+
35
+ app:layout_constraintEnd_toEndOf="parent"
36
+
37
+ app:layout_constraintBottom_toBottomOf="parent"
38
+
39
+ app:layout_constraintStart_toStartOf="parent"/>
40
+
35
- </android.support.design.widget.CoordinatorLayout>
41
+ </android.support.constraint.ConstraintLayout>
36
42
 
37
43
  ```
44
+
45
+
46
+
47
+ 追加している部分
48
+
49
+ ``` Kotlin
50
+
51
+ val items = Array(20, { i -> "Title-$i" })
52
+
53
+ val adapter = ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items)
54
+
55
+ findViewById<ListView>(R.id.list_view).adapter = adapter
56
+
57
+ ```