TSMessages
TSMessages copied to clipboard
Custom height for TSMessageView
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.
same here!
+1
Is there any solution?
+1
+1
+1
+1
+1
Ideally we can just supply our own custom view, with its own height.
+1
+1
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 There is no public property available of TSMessageView to adjust its height.
@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 Yes , you are right but still the frame remains unchanged and the TSMessageView
just shifts downwards upon changing its height.
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.
[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