1、 隱藏tableViewCell的分割線:
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
2、實現右側的小灰色箭頭 只要將cell的accessoryType屬性設置為 cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
//關閉tableView選中的動畫
[tableView deselectRowAtIndexPath:indexPath animated:NO];
//關閉tableView頂部的cell冒出來的白色空隙
self.automaticallyAdjustsScrollViewInsets = NO
開啟手勢返回
self.navigationController.interactivePopGestureRecognizer.delegate = (id)self;
3、毛玻璃效果(ios8.0以后的版本)
UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
visualEffectView.frame = CGRectMake(0, 0, 320, 180);
visualEffectView.alpha = 1.0;
4、整個項目iOS手勢(滑動)返回
1>、iOS手勢(滑動)返回首先在根控制器下 遵守UIGestureRecognizerDelegate協議
2>在跟控制器下寫入以下代碼,輕松開啟手勢返回
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
//代理置空,否則會閃退
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
//開啟iOS7的滑動返回效果
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
//只有在二級頁面生效
if ([self.navigationController.viewControllers count] == 2) {
self.navigationController.interactivePopGestureRecognizer.delegate = self;
}
}
}
5、自定義導航欄返回按鈕
UIBarButtonItem *leftBarBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"返回-1"] style:UIBarButtonItemStylePlain target:self action:@selector(goBack)];
self.navigationItem.leftBarButtonItem = leftBarBtn;
6、導航欄全透明,無黑邊
// 導航欄變為透明
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:0];
// 讓黑線消失的方法
self.navigationController.navigationBar.shadowImage=[UIImage new];