Forum Xamarin.iOS


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

UITextField Appearance

ShaneMunnShaneMunn AUBeta ✭✭
edited October 2012 in Xamarin.iOS

I'm under the impression that you can set the font for all UITextFields using the appearance protocol. When I access UITextField.Appearance, all I get access to is BackgroundColor. Am I mistaken, or is there a binding issue with the appearance protocol in MT?



  • NicWiseNicWise NZMember, Insider, Beta mod

    If you look here:

    then run this:

    cd /Applications/



    It shows your everything. UITextField has nothing....

  • ShaneMunnShaneMunn AUBeta ✭✭

    Oh. Thanks @nicwise. I was sure I'd see some code setting font information.


  • JonathanPeppersJonathanPeppers USInsider, Beta, University ✭✭

    Yeah, this is why I generally subclass UITextField to "fake" UIAppearance for it.

    Doesn't work in all cases though, you'll bump into UISearchBar and other things that use UITextField internally.

  • KojiIshiiKojiIshii JPMember

    @nicwise UILabelAppearance has the Font property though UILabel.h has no UI_APPEARANCE_SELECTOR, so it looks like the rule is not always right.

    I also tried:

    var appearance = UITextField.AppearanceWhenContainedIn(typeof(UISearchBar));
    Messaging.void_objc_msgSendSuper_IntPtr (appearance.SuperHandle, Selector.GetHandle ("setFont:"), font.Handle);

    and it looks like it works good.

Sign In or Register to comment.