1
我想在我的iPhone应用程序的UITextField
中放置临时文本。 Android有提示属性在文本字段中显示临时文本。我如何在iPhone开发中做同样的事情?UITextField提示在iPhone上使用C#
我想在我的iPhone应用程序的UITextField
中放置临时文本。 Android有提示属性在文本字段中显示临时文本。我如何在iPhone开发中做同样的事情?UITextField提示在iPhone上使用C#
UITextFields有让您设置的提示文本占位符属性:
MyTextField.Placeholder = "Required";
有二手占位为UITextField不同的方法如下
CGRect frame = CGRectMake(0, 0, 160, 29);
UITextField *search= [[UITextField alloc] initWithFrame:frame];
search.borderStyle = UITextBorderStyleRoundedRect;
search.textColor = [UIColor blackColor];
search.font = [UIFont systemFontOfSize:17.0];
search.placeholder = @"Suchen";
search.backgroundColor = [UIColor clearColor];
search.autocorrectionType = UITextAutocorrectionTypeNo;
search.keyboardType = UIKeyboardTypeDefault;
search.returnKeyType = UIReturnKeySearch;
search.clearButtonMode = UITextFieldViewModeWhileEditing;
search.delegate = self;
我希望它能帮助周到,谢谢
临时文本意味着占位符? – jamil
是的,我如何将占位符文本放入C#中的UITexField中? –
看看这里http://stackoverflow.com/a/11479680/1328096 – jamil