jessesquires / JSQMessagesViewController

An elegant messages UI library for iOS
https://www.jessesquires.com/blog/officially-deprecating-jsqmessagesviewcontroller/
Other
11.14k stars 2.81k forks source link

ViewController always scrolling down on appearance #714

Closed pflenker closed 9 years ago

pflenker commented 9 years ago

Hi there,

today I have noticed the following issue, for which I would like to ask if it is the intended behaviour: I have several media messages, some of them with images. If I tap on one of those images, I load a new view controller and push it onto the view stack to display the image. However, if this VC is popped from stack and the JSQMessagesViewController gets visible, it scrolls to the bottom instead of staying where it was.

I am on version 6.1.1. I have not overwritten viewDidAppear or viewWillAppear, and I am using scrollToBottomAnimated only once in my code, and the issue persists if I comment it out.

Thanks!

Philipp

jessesquires commented 9 years ago

Hey @pflenker - yes this is expected behavior.

To get the behavior you want, you can set self.automaticallyScrollsToMostRecentMessage = NO; before you push a new VC on the stack.

pflenker commented 9 years ago

Hey @jessesquires , thanks for your reply! When is the best place to set this property back to YES? If I do it either in viewWillAppear or in viewDidAppear , it still scrolls right to the bottom.

jessesquires commented 9 years ago

Hm... setting back to YES in viewDidAppear: should work.

pflenker commented 9 years ago

It works, the problem was on my end. Thanks again!

On 4 January 2015 at 23:23, Jesse Squires notifications@github.com wrote:

Hm... setting back to YES in viewDidAppear: should work.

— Reply to this email directly or view it on GitHub https://github.com/jessesquires/JSQMessagesViewController/issues/714#issuecomment-68652216 .

jessesquires commented 9 years ago

Awesome! :+1: