using(UIFont font=StyleHelper.Fonts.HelveticaNeueLTDMC_18
using(UIColor color=UIColor.Clear.FromHex(0xc7c7c7))
{
color.SetFill ();
base.DrawString (this.Placeholder, rect, font);
}
我正在使用上述代码,但它并没有起作用。
using(UIFont font=StyleHelper.Fonts.HelveticaNeueLTDMC_18
using(UIColor color=UIColor.Clear.FromHex(0xc7c7c7))
{
color.SetFill ();
base.DrawString (this.Placeholder, rect, font);
}
正如在MonoTouch.UIKit.UITextField.AttributedPlaceholder的iOS-API文档中所看到的,您可以清楚地看到:
myLogin.AttributedPlaceholder = new NSAttributedString (
"Enter your credentials",
font: UIFont.FromName ("HoeflerText-Regular", 24.0f),
foregroundColor: UIColor.Red,
strokeWidth: 4
);