There are lots of objective-c variations of how to access the UITextField in a UISearchbar so you can style it more specifically than the exposed SearchBar methods, i.e. we want to change -
- font type / size
- font colour
- text field background colour so searchbar is all one colour
Thought it would be nice to see Xamarin solution(s) for this as certain obj-c techniques do not seem (I may just be missing the code) to translate -
For example, in -
Change the font size and font style of UISearchBar iOS 7
- (void)viewDidLoad
{
[[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setDefaultTextAttributes:@{
NSFontAttributeName: [UIFont fontWithName:@"Helvetica" size:20],
}];
}
Looks like a winner, but not sure can translate this to Xamarin as properties not "seemingly" exposed -
UITextField.AppearanceWhenContainedIn(typeof (UISearchBar))).HowToSetFont ...
I will make a starter answer for one which I have just come across, but interested to see how other users have solved styling the searchbar too.