0

如何检索我的 UITextField 的位置?

我可以适当地创建许多 UITextField,然后将它们移动到屏幕上。然后通过以下方式(按标签),我检测到文字很好,但我也想要位置(es:GRect 0,0,0,0)。

for (UITextField *text in array2) {


int touchedtag = text.tag;

NSUInteger tagCount = touchedtag;
switch (tagCount) {
    case 1: 
        size = [NSString stringWithFormat:@"%@", text.frame];


        object = [NSString stringWithFormat:@"%@  %@", text.text, size];

        break;

 }

我试过这个(使用大小),但它不起作用。在此先感谢您的帮助

4

1 回答 1

2

textField 的位置应显示在textfield.frame. 但是如果你不想 NSLog 你需要使用的框架NSStringFromCGRect(textField.frame)

于 2012-05-05T13:22:22.683 回答