开发者

Android dynamically generating tables

开发者 https://www.devze.com 2023-01-25 08:56 出处:网络
I have an Android activity which has a header, some title text, and then I want to dynamically generate a given number of tables. In addition, I want to be able to scroll down to view all of the table

I have an Android activity which has a header, some title text, and then I want to dynamically generate a given number of tables. In addition, I want to be able to scroll down to view all of the tables on the activity (not scroll the individual tables). Is this possible? If so, can someone provide me with some guidance?

If not, the only other thing that I can think of is a list view. However my problem here is that I don't want the list view look and feel. I want a "break" between the different groupings of info开发者_如何学Crmation. So, for example:

-------------------
| January 7, 2010 |
-------------------
|  Item #1        |
|  Item #2        |
-------------------

-------------------
| January 8, 2010 |
-------------------
|  Item #1        |
|  Item #2        |   
|  Item #3        |
-------------------

etc...

Does anyone have any ideas?


What you want is actually... a TableLayout! The contents of a TableRow can be anything, including other tables. To create space between them, just add a TableRow with an empty View, sized to the height of the number of pixels that you need.

To make the whole thing scrollable, wrap the TableLayout in a ScrollView.

0

精彩评论

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

关注公众号