button
button.clipsToBounds = YES;
發(fā)現(xiàn)UIView有一個clipsTobounds的屬性,于是吧view.clipsTobounds設(shè)置為YES, 發(fā)現(xiàn)界面上button看不見了,繼續(xù)看了些clipsTobounds的資料,原來是button的frame超出了view的frame的范圍(即button的坐標(biāo)超出view的frame了), clipsTobounds默認(rèn)值是NO, 即超出范圍后依然可以顯示,但是超出范圍這部分是無法響應(yīng)觸摸事件的,把 clipsTobounds設(shè)置為YES后,超出范圍這部分的內(nèi)容就不會再顯示了。在上面的代碼中給view設(shè)置一個frame后,button的響應(yīng)就正常了。
tabBar是否透明狀態(tài)
self.tabBarController.tabBar.translucent = NO;
添加scrollView 在view上 有時候會遇到 因下拉回不去頂部 需要設(shè)置如下
self.automaticallyAdjustsScrollViewInsets = NO;
//cell分割線
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
// 取消選中這一行
[tableView deselectRowAtIndexPath:indexPath animated:YES];
//tableView的編輯模式
tableView.eniting = Yes
tableView.eniting = No