属性“出身”对象类型未找到“的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
);
答
origin
是CGRect
的成员,你必须得到一个CGRect
从你的角度来看。看看UIView
的frame
财产。
将所有发生的studentLoanTextBox.origin
更改为studentLoanTextBox.frame.origin