1、UITableView顶部多出一块
UITableView顶部多出一块,设置tableview的任何属性都不起作用。关键在这里:
UIViewController{
@property(nonatomic,assign) BOOL automaticallyAdjustsScrollViewInsets NS_AVAILABLE_IOS(7_0); // Defaults to YES
}
需要做什么呢,
self.automaticallyAdjustsScrollViewInsets = NO;
所有涉及到UIScrollerView的都有相关问题。
2、多个视图加同一个手势
UITapGestureRecognizer *imageViewTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imageViewClick:)];
同时给多个视图添加imageViewTap,只有最后一个视图对手势事件生效。
视图与手势是一对多的关系,即一个视图可以添加多个手势,一个手势只可以加到一个视图上。