2016-05-25 5 views
1

でnavigationBar用ませ色合いの色は、私がnavigationBar.tintColorを設定し、それが透明になりUINavigationControllerに拡張子がない:スウィフト

self.navigationBar.tintColor = UIColor.whiteColor() 
self.navigationBar.shadowImage = UIImage() 
self.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default) 

をしかし、私は何を持っていると思いますが可視項目で、透明ナビゲーションバーを持つことです色合いは全くありません。代わりに、ボタンの背景として画像を有するので、私は白のプレースホルダを取得

let rightButton = UIBarButtonItem(image: UIImage(named: "avatar")!, 
            style: UIBarButtonItemStyle.Plain, 
            target: self,  
            action: #selector(self.rightNavBarItemAction)) 

navigationItem.rightBarButtonItem = rightButton 

:私は、色付きの背景イメージを持っている右のナビゲーションバーの項目を追加します。 UIColor.clearColor()を使用すると、ボタンが透明になります。

+0

http://stackoverflow.com/questions/17041778/uinavigationbar-set-tintcolor-tested-in-ios7-not-workingこのリンクを試すと、デフォルトで背景色合いが白です。 –

+0

@ManishSinghデフォルトでは青です – Carpsen90

+0

barTintColorをclearColorに設定してみてください –

答えて

0

あなたはこれを試すことができます。

enter image description here

self.navigationController?.navigationBar.barTintColor = UIColor.green 
が、それはあなたのために働く願っています。ありがとう