模拟器iOS中的UITextField选择错误

时间:2013-04-02 11:38:55

标签: iphone uitextfield response

我有新的愚蠢问题,我用三个文本字段创建了子视图,我连接得很好,现在当我点击到任何 textfield 它的工作直到第三次尝试之后它不起作用,现在我很困惑到底发生了什么,我添加 textfild 通过 xib

 - (IBAction)weightMethod:(id)sender
   {

    centimeterTextField.placeholder = @"  Centimeters";
    self.centimeterTextField.delegate=self;
    self.centimeterTextField.tag=3;
    self.centimeterTextField.borderStyle = UITextBorderStyleRoundedRect;
    self.centimeterTextField.clearsOnBeginEditing=YES;
    [ self.centimeterTextField setBackgroundColor:[UIColor whiteColor]];
    ptextfield.placeholder = @"   Feet";
    self.ptextfield.delegate=self;
    self.ptextfield.tag=4;
    self.ptextfield.borderStyle = UITextBorderStyleRoundedRect;
    self.ptextfield.clearsOnBeginEditing=YES;
    [self.ptextfield setBackgroundColor:[UIColor whiteColor]];

    ptextfieldInches.placeholder = @"   Inches";
    self.ptextfieldInches.delegate=self;
    self.ptextfieldInches.tag=5;
    self.ptextfieldInches.borderStyle = UITextBorderStyleRoundedRect;
    [ptextfieldInches setBackgroundColor:[UIColor whiteColor]];
    self.ptextfieldInches.clearsOnBeginEditing=YES;
    [self.centimeterTextField setKeyboardType:UIKeyboardTypeNumberPad];
    [self.ptextfieldInches setKeyboardType:UIKeyboardTypeNumberPad];
   [self.ptextfield setKeyboardType:UIKeyboardTypeNumberPad];

 }

令人惊讶的事实是,当我没有将插座连接到任何文本字段时,它的工作直到你回应。

0 个答案:

没有答案