我有一个带有文本字段的UIAlertView。有人能帮我解决我应该怎么做才能在他们之间留下一些空间吗?警报视图中的两个文本字段,它们之间有空格
newBoatAlert.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
UITextField * alertTextField1 = [newBoatAlert textFieldAtIndex:0];
alertTextField1.keyboardType = UIKeyboardTypeDefault;
alertTextField1.placeholder = @"Name";
UITextField * alertTextField2 = [newBoatAlert textFieldAtIndex:1];
alertTextField2.frame=CGRectMake(alertTextField1.frame.origin.x, alertTextField1.frame.origin.y+alertTextField1.frame.size.height+10, alertTextField1.frame.size.width, alertTextField1.frame.size.height+40);
alertTextField2.keyboardType = UIKeyboardTypeDefault;
alertTextField2.placeholder = @"Description";
alertTextField2.secureTextEntry=NO;
现在看起来是这样的:
你将需要为此创建自定义控件。 –
你不应该再使用UIAlertView,它已经在iOS 8中被弃用了。https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertView_Class/ – LoVo
感谢兄弟 –