简体   繁体   中英

How to layout two ios UITableViews, side by side?

I have a customer who wants a view layout that contains both the typical full-width grouped-style rows, but then also another section on the same view that contains two side by side table views.

So, like this:

______________
______________
______  ______
______  ______
______  ______

______________
______________

Any clever ways to accomplish this? I realize that this kinda goes against iOS paradigms, but I want to explore options before telling the designer "no".

You could have a view controller (lets call it A), that would be responsible for text above and below the 2 tables. Then, you could add 2 view controllers to A. Each one would be responsible for each table. Although I think the interface will be a little confuse, I think its correct way of doing. For adding your view controllers to A:

Table1ViewController *table1=[Table1ViewController alloc] initWithNibName:@"Table1ViewController" bundle:nil];

[self.views addSubView:table1];

table1.frame=CGRectMake(...,...,...,...) //Here you would define how you want to position your table.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM