简体   繁体   中英

iOS horizontal and vertical Scrolling UITableView

I am new to iOS and exploring various facets of this. I am looking to create a UITableView with each cell of the table view having a horizontal scrolling table view. I am new to iOS.

My custom class inheriting from UITableViewCell will contain a UITableView property. What next ?

I have dragged a TableView into the Prototype Cell of my Table View. This table view in my TableView cell will need to horizontal scrolling. I have created a IBOutlet for the TableView in my class inheriting from UITableViewCell . How can i tell that this class will be the UITableViewDelegate , UITableViewDataSource of this inner table view ?

在此处输入图片说明

Am I on the right path ? I am using storyboards and iOS 7 .

You simply specify that the UITableViewCell subclass conforms to the delegate/datasource protocols the same as you would if this was within a view controller. From there, you link the table's delegate/datasource properties to the cell.

However, I recommend you use the UICollectionView class for your horizontal sculling needs, it will make the entire process a lot less painful. My first point applies when using UICollectionView as well.

For example:

@interface MyCell : UITableViewCell <UICollectionViewDelegate, UICollectionViewDatasource>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@end

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