TSMessages icon indicating copy to clipboard operation
TSMessages copied to clipboard

Custom height for TSMessageView

Open kartikthapar opened this issue 9 years ago • 18 comments

Is there a way to customize the message view height? I want the height of the message view to be same as that of a navigation bar, i.e. 44px.

kartikthapar avatar Mar 06 '15 14:03 kartikthapar

same here!

EmmanuelC19 avatar May 31 '15 15:05 EmmanuelC19

+1

anwhat avatar Jun 10 '15 09:06 anwhat

Is there any solution?

ridvank avatar Jun 30 '15 11:06 ridvank

    I want smaller height like Facebook Message app.

trungnguyen1791 avatar Jun 30 '15 18:06 trungnguyen1791

+1

tonchis avatar Jul 08 '15 20:07 tonchis

+1

tbaranes avatar Jul 09 '15 06:07 tbaranes

+1

argoel avatar Jul 17 '15 09:07 argoel

+1

dakimaru avatar Aug 07 '15 03:08 dakimaru

+1

tbaranes avatar Aug 07 '15 06:08 tbaranes

Ideally we can just supply our own custom view, with its own height.

aehlke avatar Aug 11 '15 17:08 aehlke

+1

anneTaterTot avatar Aug 19 '15 18:08 anneTaterTot

+1

johnnypayso avatar Oct 08 '15 17:10 johnnypayso

One option is to set the TSMessageViewProtocol delegate on the sharedMessage instance ofTSMessage. Then, implement - (void)customizeMessageView:(TSMessageView *)messageView. Because this library still uses springs/struts, you should be able to customize the view to your heart's content without having to worry about layout constraints that you don't manage.

staufman avatar Jan 07 '16 00:01 staufman

@staufman There is no public property available of TSMessageView to adjust its height.

SandeepAggarwal avatar May 30 '16 09:05 SandeepAggarwal

@SandeepAggarwal It has been a while now but since TSMessageView is just a UIView, you should just be able to change its frame right?

staufman avatar May 30 '16 20:05 staufman

@staufman Yes , you are right but still the frame remains unchanged and the TSMessageView just shifts downwards upon changing its height.

SandeepAggarwal avatar May 31 '16 06:05 SandeepAggarwal

The fact that something is changing means it's most likely something in your view hierarchy that is causing the problem. Without knowing more about your particular codebase, I'm not sure what, offhand, would be causing this.

staufman avatar May 31 '16 17:05 staufman

[TSMessage setDelegate:self];

- (void)customizeMessageView:(TSMessageView *)messageView {
    [messageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@44);
    }];
}

or whatever height you want

tested on ios 8 and 9

aafa avatar Jul 19 '16 13:07 aafa