Reputation: 367
I tried the code
UIbutton *bt = new UIbutton;
bt.Font = UIFont.SystemFontSize(35);
But I keep getting a compilation error "Font size is inaccessible due to protection level." Any workaround?
Upvotes: 6
Views: 2417
Reputation: 32694
The error message is far from ideal, but SystemFontSize
is property that returns a float, not a method that returns a UIFont
.
For that you want:
UIButton button = UIButton.FromType (UIButtonType.RoundedRect);
bt.Font = UIFont.SystemFontOfSize (35)
Upvotes: 6