I am experiencing something that is considered a mistake in my situation. This is probably not a mistake, but a function;).
Here is my case:
I am loading a UIScrollView with my content. Part of my content is loaded asynchrone after the view is already loaded. This works great and no problem. However, some of these controls are UITextView controls. Once I set the contents (text property) of these controls after viewDidLoad, my UIScrollView scrolls to the last set UITextView. I want to prevent this and want the UIScrollView to maintain its top scroll position.
In short: If I set the Text property in the viewDidLoad method, scrolling is not performed. If I set the Text property to a UITextView after the viewDidLoad method (because I load data asynchronously), the UIScrollView will scroll to the last set UITextView. I want to prevent this scroll.
How do I achieve this? I have the feeling that this is just a property that is configured incorrectly, but I cannot find it.
Thanks in advance.
EDIT:
I tried setting the scrollEnabled property to NO before setting the values ββto YES, but this did not affect. ScrollView will still scroll when the text property of UITextView is set.
objective-c iphone cocoa-touch uitextview uiscrollview
Gidogeek
source share