Tag: uitextfield

如何以编程方式从UITextField禁用复制粘贴选项

我正在做一个注册alertview有一个UITextField在用户可以input他们的注册号码。 一切都非常他们,但是我想从编程的文本域中删除复制粘贴function,因为他们是没有InterfaceBuilder版本的文本域我不知道如何做到这一点.. 这里是我的UIalertview到目前为止… – (void)pleaseRegisterDevice { UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Please Register Device!" message:@"this gets covered" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil]; regTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)]; [regTextField setBackgroundColor:[UIColor whiteColor]]; regTextField.textAlignment = UITextAlignmentCenter; [myAlertView addSubview:regTextField]; [myAlertView show]; [myAlertView release]; }

iOS – 在触摸UITextField外部时closures键盘

我想知道如何让用户在UITextField之外触摸时使键盘消失。

如何使用Swift在文本字段(从右到左)input货币格式?

我有一个数字让我们说0.00 。 当用户点击1时,我们应该有0.01 当用户点击2.我们应该显示0.12 当用户点击3.我们应该显示1.23 当用户点击4.我们应该显示12.34 我怎么能用Swift来做到这一点?