ListViewXml

 listview里面的内容

法一:

step1 直接在strings.xml里加上string-array

step2 然后在listview属性里加上entries即可

<LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        
        <ListView 
        android:id="@+id/lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:entries="@array/food"></ListView>
        
        
    </LinearLayout>

法二

step1 在values新建一个food.xml即可 之后同上

 注:

原文地址:https://www.cnblogs.com/hishark/p/7513262.html