开发者

iphone UITableView creation dynamically

I want to create multiple UITableViews dynamically. Depending on the selection on the previous view controller, the current one should decide how many UITableViews are needed.

e.g. If the user chooses to see 2 different types of Data (height and weight) I want to show 2 tables with that information. If he selects 3 (height, weight and waist size) I want to show 3 table开发者_JAVA百科s.

Can you please help.


You can create as many UITableViews as you want, e.g. with

UITableView *tbl1 = [[UITableView alloc] initWithFrame:CGRectMake(0,0,320,200)];
[self.view addSubview:tbl1];
[tbl1 release];
UITableView *tbl2 = [[UITableView alloc] initWithFrame:CGRectMake(0,200,320,200)];
[self.view addSubview:tbl2];
[tbl2 release];
...

However, i'm not sure what are you trying to accomplish, you could try to provide a sketch or a wireframe. Are you looking into including more tableviews in one view, or rather in separate screens?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜