目錄
1、stringByAppendingPathComponent和stringByAppendingString的區別
2、解決其它手勢導致側滑返回手勢(interactivePopGestureRecognizer)失效的方法
1、stringByAppendingPathComponent和stringByAppendingString的區別
stringByAppendingString是字符串拼接,拼接路徑時要在名稱前加“/”;
stringByAppendingPathComponent是路徑拼接,會在字符串前自動添加“/”,成爲完整路徑。
例如:
NSString *imagePath = [skinPath stringByAppendingString:[NSString stringWithFormat:@"/%@",imageName]];
NSString *imagePath = [skinPath stringByAppendingPathComponent:imageName]; NSLog(@"imagePath:%@",imagePath);
2、解決其它手勢導致側滑返回手勢(interactivePopGestureRecognizer)失效的方法
2.1 自定義手勢導致失效
[selfGestureRecognizer requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer];
2.2 ScrollView導致失效
[selfScrollView.panGestureRecognizer requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer];
解決方法
myGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureAction:)];
[myGesture requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer];
[self.view addGestureRecognizer:myGesture];
3、改變headerView/footerView的背景顏色
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(nonnull UIView *)view forSection:(NSInteger)section {
view.tintColor = [UIColor clearColor];
}