请参考下面的代码。
只需复制粘贴以下代码即可 viewdidload()
textfield.attributedPlaceholder = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"Yourtext%@",Placehodertext] attributes:@{NSForegroundColorAttributeName: color}];
将的指派UITextfield
给self
。
textfield.delegate = self
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
textfield.text = @"Yourtext"
return YES;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句