-1

リスト アクティビティ クラスを作成し、配列アダプターを作成しました。ただし、実行時に生成されるリストの外観を変更するにはどうすればよいですか。色やスタイルなどを変更する方法と同様に、

前もって感謝します。

4

2 に答える 2

1

フォルダにを作成して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
于 2013-04-23T20:24:08.670 に答える
0

ListViewまたは ListView 内の任意のビューにTheme & Stylesおよび xml 属性を使用できます

于 2013-04-23T20:22:53.243 に答える