属性“出身”对象类型未找到“的UITextField”

问题描述:

我想,当键盘出现在iPhone上滚动我的文本框了起来,我使用下面的代码,但我得到的错误:属性“出身”对象类型未找到“的UITextField”

Property 'origin' not found on object type 'UITextField'

studentLoanTextBox.frame = CGRectMake(
    studentLoanTextBox.origin.x, 
    studentLoanTextBox.origin.y - 100.0, 
    studentLoanTextBox.frame.size.width, 
    studentLoanTextBox.frame.size.height 
); 

originCGRect的成员,你必须得到一个CGRect从你的角度来看。看看UIViewframe财产。

将所有发生的studentLoanTextBox.origin更改为studentLoanTextBox.frame.origin