リスト アクティビティ クラスを作成し、配列アダプターを作成しました。ただし、実行時に生成されるリストの外観を変更するにはどうすればよいですか。色やスタイルなどを変更する方法と同様に、
前もって感謝します。
リスト アクティビティ クラスを作成し、配列アダプターを作成しました。ただし、実行時に生成されるリストの外観を変更するにはどうすればよいですか。色やスタイルなどを変更する方法と同様に、
前もって感謝します。
フォルダにを作成してstyles.xml
から、次のようなことを行うことができますvalues
<!-- ListView -->
<style name="List_Item" parent="@android:style/Widget.ListView">
<item name="android:background">@drawable/list_item_bg</item> // if you have a drawable you want to use
//add whatever other attributes you want
</style>
次に、xmlであなたListView
のスタイルをあなたのデルケアと一緒に
<ListView
android:id="@+id/listID"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/search_plate"
style="@style/List_Item"/> //here you implement your style
ListViewまたは ListView 内の任意のビューにTheme & Stylesおよび xml 属性を使用できます