iOS13適配總結(jié)

1.原來的設(shè)置tabBarTitle選中及未選中狀態(tài)的顏色代碼失效

使用新代碼

if (@available(iOS 13.0, *)) {
         UITabBarAppearance *appearance = UITabBarAppearance.new;
        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
        UITabBarItemStateAppearance *normal = appearance.stackedLayoutAppearance.normal;
        UITabBarItemStateAppearance *selected = appearance.stackedLayoutAppearance.selected;
            if (normal) {
                normal.titleTextAttributes = @{NSForegroundColorAttributeName:k_TabbrTextColor,NSParagraphStyleAttributeName : paragraphStyle};
            }
            if (selected) {
            selected.titleTextAttributes = @{NSForegroundColorAttributeName:k_TabbrSelectedTextColor,NSParagraphStyleAttributeName : paragraphStyle};
            }
            self.tabBar.standardAppearance = appearance;
        }

2.原本設(shè)置cell的accessoryType
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
如果你不準備適配暗夜模式,只將cell的背景色統(tǒng)一設(shè)置,UITableViewCellAccessoryDisclosureIndicator同樣會將箭頭圖片的顏色進行修改,導致和cell背景色顏色相近。
解決辦法是使用accessoryView屬性,
self.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_arrowright_gray"]];

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內(nèi)容