XMLがこのように設定しています。
ListViewに表示される文字の色を変更したいのですが、textの色が設定できそうにありませんでした。
セルの色はどのように指定すれば良いのでしょうか?
XML
1<?xml version="1.0" encoding="utf-8"?> 2<android.support.constraint.ConstraintLayout 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 xmlns:tools="http://schemas.android.com/tools" 5 xmlns:app="http://schemas.android.com/apk/res-auto" 6 android:layout_width="match_parent" 7 android:layout_height="match_parent" 8 tools:context=".MainActivity"> 9 <ListView 10 android:id="@+id/list_view" 11 android:layout_width="395dp" 12 android:layout_height="715dp" app:layout_constraintTop_toTopOf="parent" 13 app:layout_constraintEnd_toEndOf="parent" 14 app:layout_constraintBottom_toBottomOf="parent" 15 app:layout_constraintStart_toStartOf="parent"/> 16</android.support.constraint.ConstraintLayout>
追加している部分
Kotlin
1val items = Array(20, { i -> "Title-$i" }) 2val adapter = ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items) 3findViewById<ListView>(R.id.list_view).adapter = adapter
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/28 00:39
2019/02/28 02:47 編集
2019/02/28 08:31
2019/02/28 08:59
2019/02/28 09:13
2019/02/28 10:54