开发者

Android: viewing tabular data

开发者 https://www.devze.com 2023-02-04 17:55 出处:网络
In android, there is the ListActivity. However, what if I want multiple lists in the same Activity? For instance:

In android, there is the ListActivity. However, what if I want multiple lists in the same Activity? For instance:

Vehicles [Add Vehicle]

1999 Fo开发者_运维技巧rd Focus

2001 Nissan Altima

Drivers [Add Driver]

John Doe

Jane Doe

How would I create a view like what you see above? The list of vehicles and list of drivers would be populated based on List<Vehicle> and List<Driver>, respectively.

I want functionality like the <h:DataTable> in JSF.

Also, I know about the TableLayout. However, that doesn't help me since I can't attach an array adapter to it or anything like that.


First of all, there's the ListView element, which is what a ListActivity uses.

If you want to have several of those, you could put both of them into a LinearLayout and give each one a weight of 1 so they share the screen. They will have scrolling functionality built in, and scroll independently.

0

精彩评论

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