适配iOS13

适配iOS13中遇到的问题:

  1. /Users/peilinghui/Dog/Dog/ViewController/HomeViewController/PSTCollectionView.m:1624:47: Multiple methods named ‘numberOfItemsInSection:’ found with mismatched result, parameter type or attributes

解决方法:
原来是: NSInteger numberOfBeforeSection = [_update[@”oldModel”] numberOfItemsInSection:updateItem.indexPathBeforeUpdate.section];
改成: NSInteger numberOfBeforeSection = [(UICollectionView *)_update[@”oldModel”] numberOfItemsInSection:updateItem.indexPathBeforeUpdate.section];

  1. library not found for -lstdc++.6
    解决方法:直接到GitHUB上。https://github.com/devdawei/libstdc-下载,然后只能sh命令就能直接解决
  1. -[UIView setGrowingHook_textChangeNumber:]: unrecognized selector sent to instance 0x7fba1242cfb0
  1. 模态
1
2
3
4
5
6
7
要改回原来模态视图样式,我们只需要把UIModalPresentationStyle设置为UIModalPresentationFullScreen即可。

ViewController *vc = [[ViewController alloc] init];
vc.title = @"presentVC";
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self.window.rootViewController presentViewController:nav animated:YES completion:nil];
  1. iOS13碰到设置tabbar字体为选中状态颜色,正常切换没有问题,push后再返回,选中颜色变化系统蓝色
    目前碰到这种状况有两种方法
    这个是子视图影响所以用tintColor试试
    tintColor有寻找和传递
    1、寻找也就是通过get方法获取属性的值。
    2、传递也就是当主动改变tintColor时

方法1
self.tabBar.tintColor = [UIColor blackColor];

方法2
if (@available(iOS 10.0, *)) {
self.tabBar.unselectedItemTintColor = [UIColor blackColor];
} else {
// Fallback on earlier versions
}

上面亲测没有用

用下面的:

1
[[UITabBar appearance] setUnselectedItemTintColor: [UIColor colorWithRed:127/255.0 green:127/255.0 blue:127/255.0 alpha:1]];
  1. 适配暗黑模式
  1. 把UIWebView替换成WKWebView
文章目录
本站总访问量 本站访客数人次 ,