iOS13-設置tabbar shadowImage 失效。

UIImage *BGImage = [UIImage imageNamed:@""];
UIImage *shadowImage = [UIImage imageNamed:@""];
       
       
[UIView transitionWithView:tabBarController.tabBar duration:0.5 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
	//針對ios13 進行設置
	if (@available(iOS 13.0, *)) {
         UITabBarAppearance *appearance = [tabBarController.tabBar.standardAppearance copy];
         appearance.backgroundImage = BGImage;
         appearance.shadowImage = shadowImage;
         tabBarController.tabBar.standardAppearance = appearance;
     } else {
         tabBarController.tabBar.backgroundImage = BGImage;
         tabBarController.tabBar.shadowImage = shadowImage;
     }
       
  } completion:NULL];
發佈了28 篇原創文章 · 獲贊 3 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章