Reputation: 20980
I am new to Xamarin and iOS. I am setting Image on Button
via both the way design and programatically.
Design Way :
my Image name is Pen.png
.
Programatically Way :
btnEditAccount.SetImage(UIImage.FromFile("Pen.png"), UIControlState.Normal);
But in Both case My Image not set well. It Complete White Image. But on Button it display below Image.
Output :
I Expect :
Is there any Property I miss for my understing ?
How to set full white Image on Button.
Any Help be Appreciated.
Upvotes: 0
Views: 673
Reputation: 20980
Finally I set TintColor
to Button
Image and it will solve the Probelm.
Programatically this way
btnEditAccount.SetImage(UIImage.FromFile("Pen.png"), UIControlState.Normal);
btnEditAccount.TintColor = UIColor.White;
Upvotes: 0
Reputation: 4815
button.setImage(UIImage.init(named: "icon (5).png"), forState: .Normal)
button.tintColor = UIColor.clearColor()
Upvotes: 0