iOS 針對於13.0和暗黑模式出現的適配問題


1,更新了Xcode11.0之后,在iOS13.0中presentViewController和之前彈出的樣式不一樣。

恢復到之前樣式的解決方案:(設置VC.modalPresentationStyle)

viewcontroller *vc = [[viewcontroller alloc]init];

vc.modalPresentationStyle = UIModalPresentationFullScreen;

 [weakSelf presentViewController:webView animated:YES completion:nil];

2,友盟崩潰問題

解決方案:更新最新的友盟SDK

3,13.0暗黑模式來襲,如何先屏蔽13.0的暗黑模式

解決方案:info文件中加入

<key>UIUserInterfaceStyle</key>

<string>Light</string>

4,增加了藍牙一直使用的權限請求

解決方案:在info.plist里增加

<key>NSBluetoothAlwaysUsageDescription</key>

<string>我們想要一直使用您的藍牙功能來使定位更准確</string> 
 
5,UITextField的私有KVC- (void)setValue:(nullable id)value forKeyPath:(NSString *)keyPath 會導致崩潰問題(其他的控件KVC可能也會導致崩潰問題,目前還未發現,請謹慎使用)
例如 [_PhonetextField setValue:self.placeholdersColor forKeyPath:@"_placeholderLabel.textColor"];
解決方案: NSMutableAttributedString *placeholderString = [[NSMutableAttributedString alloc] initWithString:placeholder attributes:@{NSForegroundColorAttributeName : self.placeholderColor}]; _textField.attributedPlaceholder = placeholderString;
 
6,iOS 13.0獲取deviceToken方法更改
之前的獲取方式:

[[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""]

                                 stringByReplacingOccurrencesOfString: @">" withString: @""]

                                stringByReplacingOccurrencesOfString: @" " withString: @""]

 
13.0后的獲取方式:

if (![deviceToken isKindOfClass:[NSData class]]) return;

        const unsigned *tokenBytes = [deviceToken bytes];

        NSString *deviceTokens = [NSString stringWithFormat:@"%08x%08x%08x%08x%08x%08x%08x%08x",

                              ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]),

                              ntohl(tokenBytes[3]), ntohl(tokenBytes[4]), ntohl(tokenBytes[5]),

                              ntohl(tokenBytes[6]), ntohl(tokenBytes[7])];

    NSLog(@"deviceTokens:_______________%@",deviceTokens);

7,iOS 13.0暗黑模式運行后發現狀態欄變為白色,設置[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault不起作用

解決方案:首先可能是 info.plist

<key>UIViewControllerBasedStatusBarAppearance</key>

<false/>

false換成true可以設置全局為黑色,但是如果部分界面需要用到白色的狀態欄顏色,不能設置全局黑色,那么在最新的iOS13.0新增了狀態欄顏色屬性UIStatusBarStyleDarkContent

在需要設置成黑色的控制器中加入iOS 13.0的判斷

-(void)viewWillAppear:(BOOL)animated{

    if (@available(iOS 13.0, *)) {

        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDarkContent;

    } else {

        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;

    }

}

 8,在最新的iOS13.0后蘋果強制加入了 Sign in with Apple(蘋果登錄),如果您的app中包含了其他的三方登錄,那么這個蘋果登錄也需要加進去。

9,iOS 13.0以后,蘋果停止了對UIWebview的維護,將全面替換成WKWebview,app審核時會出現警告,但是可以繼續使用,聽說有的人因為UIWebView的問題審核被拒了,這個還有待更新。

10,iOS13.0,Xcode11 項目中使用SJVideoPlayer三方播放器的發生崩潰問題,

解決方案:替換三方庫里面的一個.m文件

點擊SJAVMediaMainPresenter.m.zip下載。(問題及解決方案在下面的鏈接里面)

 https://github.com/changsanjiang/SJVideoPlayer/issues/153#issuecomment-534364750

有其他的問題將持續更新!

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM