开发者

Update a UITextField in a not visible section of UIScrollView without focusing it?

开发者 https://www.devze.com 2023-03-20 05:20 出处:网络
I have to update the text of a UITextField in a not visible section of my UIScrollView but, when I try it, it move the scrollview to it. I don开发者_运维技巧\'t want this but how can I update my not v

I have to update the text of a UITextField in a not visible section of my UIScrollView but, when I try it, it move the scrollview to it. I don开发者_运维技巧't want this but how can I update my not visible uitextfield without move the scrollview? Thanks, Alleria


It is a little unclear what exactly you are trying to do, but I am guessing its either of these, and I am posting them below.

Declare that textField as a property. UITextField *myTextField

If you want to edit that, you can use [myTextField becomeFirstResponder] . This will bring up a keyboard for you to type and enter details, and then you can resignFirstResponder.

If you just want that textField to contain some text, you can just use

self.myTextField.text = @"Some Text";
0

精彩评论

暂无评论...
验证码 换一张
取 消