1
UITabBarControllerのView Controllerのビューに影を追加したいとします。誰もが考えている?あなたはあなたがに影の効果を適用するには、これを試すことができますSwift 3.0の下の画像のように動作する方法iOS
tabBar.barStyle = UIBarStyle.Default
tabBar.translucent = false
tabBar.layer.shadowColor = UIColor.grayColor().CGColor
tabBar.layer.shadowOpacity = 0.8
tabBar.layer.shadowOffset = CGSizeZero
tabBar.layer.shadowRadius = 3
UITabBar.appearance().shadowImage = UIImage()
UITabBar.appearance().backgroundImage = UIImage()
役立つ、このコードを見つけることができます
詳細にUITabBar.appearance().shadowImage = UIImage(named:"YOURIMAGE")
UITabBar.appearance().backgroundImage = UIImage(named:"YOURIMAGE")
あなたのタブバーにshowdonを追加する。このように
これは、タブバーに影を付けたい場合に最適です。しかし、ViewControllerのタブバー項目のビューには影が必要です。 TabbarはView Controllerの下にあります。 –
@AmitGajjarあなたはこれを試すことができます: - 私の編集コード –