Reputation: 41
Here is the example I made
self.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(Title:"want to let this text be smaller", UIBarButtonItemStyle.Plain, (object sender, EventArgs e) => webView.EvaluateJavascript ("window.location.href=")), true);
I tried so many ways but not solve this problem yet.
Upvotes: 1
Views: 1383
Reputation: 7850
Try this:
var button = new UIBarButtonItem("want to let this text be smaller", UIBarButtonItemStyle.Plain, (object sender, EventArgs e) => webView.EvaluateJavascript ("window.location.href="));
var fontAttribute = new UITextAttributes();
fontAttribute.Font = UIFont.SystemFontOfSize(8);
button.SetTitleTextAttributes(fontAttribute, UIControlState.Normal);
NavigationItem.SetRightBarButtonItem(button, true);
Upvotes: 2