How to change color and font of UITextField Placeholder in Xamarin for iOS7

using(UIFont font=StyleHelper.Fonts.HelveticaNeueLTDMC_18
using(UIColor color=UIColor.Clear.FromHex(0xc7c7c7))
{
    color.SetFill ();

    base.DrawString (this.Placeholder, rect, font);

}

I use the code above, but it does not work.

+4
source share
1 answer

As you can see from the iOS-API documentation for MonoTouch.UIKit.UITextField.AttributedPlaceholder , you can clearly see:

myLogin.AttributedPlaceholder = new NSAttributedString (
    "Enter your credentials",
    font: UIFont.FromName ("HoeflerText-Regular", 24.0f),
    foregroundColor: UIColor.Red,
    strokeWidth: 4 
);
+9
source

All Articles