开发者

IPhone App: UIScrollView scrolls to bottom when it loads

I have a detail view for a contact. The last field is a Textview that can be as short as 1 line and as long as 20. in the viewDidLoad method I use:

scrollView.contentSize = self.view.frame.size;

My prob开发者_Go百科lem is that when the data is displayed, the scroll view scrolls to the bottom on its own. Obviously I would like it to start at the top.

I used the Content offset with the bottom value set to about 300 to allow the view to even be able to scroll down far enough. I have tried to disable scrolling until the load is finished but then it just locks you at the bottom.

As you can probably tell I am new at iPhone Programming. Any ideas?


Set contentOffset to 0.

Then, go and read the docs. you're using the scroll view completely wrong.

UITextView is scrollable, so it's unclear why you're sticking it in a scroll view.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜