created UIBarButtonItem
added Power Image to it.
barBtnPower = new UIBarButtonItem (UIImage.FromBundle ("Images/[email protected]")
, UIBarButtonItemStyle.Plain
, (sender, args) => {
});
button added to navigation Item on right side.
this.NavigationItem.SetRightBarButtonItem (barBtn_Logout, true);
Issue is [email protected] is in green colour. but after run the application its shows in blue.
Can any one advice what i have done wrong here.
Use the always original rendering mode, if you don't want the navigation bar's tintColor property to effect your button's color.
barBtnPower = new UIBarButtonItem (UIImage.FromBundle("Images/[email protected]").imageWithRenderingMode(.AlwaysOriginal)
, UIBarButtonItemStyle.Plain
, (sender, args) => {});
Updated answer with Swift 5
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "roulette")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(buttonRouletteClicked))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With