我有三個UITextfields
在UIAlertView
,而水龍頭上一個UITextfield
並嘗試挖掘其他的沒有選擇,創造出了問題,也辭職第一響應的問題,是它使用UITextfield
不是好選擇UIAlertView
UitextFields在UIAlertView中選擇iOS的
- (IBAction)heightMethod:(id)sender
{
self.centimeterTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
centimeterTextField.placeholder = @" Centimeters";
self.centimeterTextField.delegate=self;
self.centimeterTextField.tag=3;
[ self.centimeterTextField setBackgroundColor:[UIColor whiteColor]];
[self.alertHeight addSubview: self.centimeterTextField];
self.ptextfield = [[UITextField alloc] initWithFrame:CGRectMake(40, 80.0, 80, 25.0)]; ptextfield.placeholder = @" Feet";
self.ptextfield.delegate=self;
self.ptextfield.tag=4;
[self.ptextfield setBackgroundColor:[UIColor whiteColor]];
[self.alertHeight addSubview:self.ptextfield];
self.ptextfieldInches = [[UITextField alloc] initWithFrame:CGRectMake(140, 80.0, 80, 25.0)]; ptextfieldInches.placeholder = @" Inches";
self.ptextfieldInches.delegate=self;
self.ptextfieldInches.tag=5;
[ptextfieldInches setBackgroundColor:[UIColor whiteColor]];
[self.alertHeight addSubview:ptextfieldInches];
[self.centimeterTextField setKeyboardType:UIKeyboardTypeDecimalPad];
[self.ptextfieldInches setKeyboardType:UIKeyboardTypeDecimalPad];
[self.ptextfield setKeyboardType:UIKeyboardTypeDecimalPad];
self.alertHeight.tag=1;
[self.alertHeight show];
}
,粘貼代碼 –
是的,請張貼代碼在這裏 – Prashant
使用標籤的正確textfild及其委託檢查與巫Textfild呼籲。或者可能會忘記給三個TextFiled之一的代表進行正確檢查。 –