简体   繁体   中英

Split UITableview horizontally in IOS?

I have a SQLite project in IOS for Ipad. the database contains one table with a lot of products. what I want to do is separate this products into categories. so that i can make a separate tableview for each category. So my question is, can I use one table view with different sections, but put this sections side by side horizontally? The application only work on landscape mode. I hope the question is clearly enough. Thank's.

在此处输入图片说明

You can achieve this using a UICollection view (iOS6+ only, but there is an open source back-port here ), or you can roll your own using scroll views.

The collection view scrolls horizontally, and has a number of items matching the sections in your catalogue.

Each cell of the collection view contains a header and a table view, holding the detail from the appropriate section.

Use child view controllers to keep your code clean - the view for each cell should be managed by its own view controller, which doesn't need to know it is in a collection view cell.

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