最简单的listview实现
程序员文章站
2022-06-15 13:54:07
...
private ListView mLvShopGrade;
mLvShopGrade = (ListView)view.findViewById(R.id.lv_shop_grade);
List<String> mStrings = new ArrayList<>();
for (int i = 'A'; i <= 'Z'; i++) {
mStrings.add("当前是数据--------------->" + (char) i);
}
mLvShopGrade.setAdapter(new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, mStrings));