Implement a grid on iPad with UITableView... question
I need to build a grid such as this one on iPad: http://showyou.files.wordpress.com/2011/04/showyou_ipad_grid_overtheshoulder.jpg
So far, I know I can use UITableView and I'm 开发者_如何学Cadding a subView to cell: rowView.
Now... since I've just started working with iOS and I don't want to break MVC model. Can I just a define a new view rowView and add it to UITableViewCell ?
What if I need to define interaction in the view ? Such as pushing a new UIViewController on screen after tapping ?
Thanks
I am not sure how to help you properly on this, so I'll try first by answering your questions:
You can add subviews to tableviewcells during runtime.
If you need interactions you can implement the touchesXXX methods in your custom views you can also add targets to any UIControl descendant such as a UIButton, which may be part of your custom view.
EDIT
You can use UIGestureRecognizer since iOS 3.2 and add those to UIViews such as
- UITapGestureRecognizer
- UIPinchGestureRecognizer
- UIRotationGestureRecognizer
- UISwipeGestureRecognizer
- UIPanGestureRecognizer
- UILongPressGestureRecognizer
so you don't have to handle the actions in your views but instead in your view controllers.
精彩评论