jessesquires / JSQMessagesViewController

An elegant messages UI library for iOS

Home Page:https://www.jessesquires.com/blog/officially-deprecating-jsqmessagesviewcontroller/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First message is overlapped by Navigation bar,scroll to top.

shravanteegala opened this issue · comments

when i send message it shows correctly first time.but i went back and come again it shows to
scroll view scroll to top. so my first message view overlapped by navigation bar.
please help me.
simulator screen shot 08-jun-2017 8 10 15 pm

@shravanteegala If you create it using a UINavigationBar class, then do this:

topContentAdditionalInset = navigationBar.frame.height

in your viewDidAppear()

It leaves enough space for your navigationbar at the top of collectionView, if you need more just change the height to like:

topContentAdditionalInset = navigationBar.frame.height * 1.2

I didn't find topContentAdditionaInset property ?

Are you using JSQMessageViewController? just type topContentAdditionalInset in your viewDidLoad and you will see it

To demonstrate that this works, I will show you my chat:

screen shot 2017-06-20 at 8 17 32 pm

Did you subclass JSQMessageViewController? what is BBJSQMessageViewController, it should say JSQMessageViewController and declaring the class should look like this:

screen shot 2017-06-21 at 9 31 37 pm

Yes I subclass the BBJSQMessageViewController:JSQMessageViewController.but that property not found error. in Objective-C.
like...below my code.

@interface BBJSQMessageViewController : JSQMessagesViewController <UIActionSheetDelegate, JSQMessagesComposerTextViewPasteDelegate,JSQMessagesCollectionViewDataSource,ImageCropViewControllerDelegate,UIDocumentInteractionControllerDelegate>
{
ImageCropView* imageCropView;
}

weird, not too sure then, im using IOS Swift, cant help more then, sorry

@shravanteegala How about self.additionalContentInset.top?

@shravanteegala did self.navigationController.navigationBar.translucent = NO; fix the problem?

Thank you.