开发者

Android: Custom ListView

I 开发者_如何转开发want to create list view just like this: http://dl.maximumpc.com/galleries/androidpower/Alarm_full.jpg I need to create view like on second and fourth screens. As for fourth screen, it seems that each row has it's own layout... I've searched Internet and even downloaded alarm source code from git repository, but it doesn't contains what I want. Any help would be useful. Thanks!


The second screen is pretty straightforward. It's basically a RelativeLayout with a full-width button at the top and a listview. The listview items will use a custom layout e.g. a RelativeLayout with a Button showing the time, a TextView to show the description, a TextView to show the selected days and a CheckBox to indicate selection. The fourth screen looks like a preference activity which can be built up from an xml file and/or custom preferences.


Yes, as John J Smith said, it's not very complicated. And i'm sure there are many articles on Internet about how to build a custom list view(at least there're many in China).

And here is a general way to do this: To custom a list view, follow these ways in general: 1. create your own list adapter, usually extends BaseAdapter, write getView method etc; 2. bind your adapter to a list view; 3. write a layout file implements your list view item, and bind data in your adapter.

Especially, if your custom list view item has a button/checkbox/etc, you'll need more work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜