Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Max height for JSQMessagesComposerTextView #323

Closed
mrojas opened this issue May 27, 2014 · 14 comments
Closed

Max height for JSQMessagesComposerTextView #323

mrojas opened this issue May 27, 2014 · 14 comments
Milestone

Comments

@mrojas
Copy link

mrojas commented May 27, 2014

It would be nice if JSQMessagesComposerTextView had a property "maxHeight" or "maxLines", which is used to determine how tall the input field can grow.
Currently there is not limit, so if you type a huge message the text view takes the entire screen.

JSQMessagesComposerTextView is already observing UITextView notifications, so it could be done like described here: http://corecocoa.wordpress.com/2013/11/09/auto-growing-uitextview-using-auto-layout/

If "maxLines" is prefered, we can use the UIFont method to determine the line height.

Do you think this would be useful for other users?

@jessesquires
Copy link
Owner

@mrojas - let's see if there are other requests for this feature. i'd be happy to accept a PR, too.

a maximumHeight is definitely the right way to do this -- not maximum lines or line height.

@wdcurry
Copy link

wdcurry commented May 27, 2014

this is a very logical augmentation..

@jessesquires
Copy link
Owner

it should actually be a pretty simple addition.

@mrojas
Copy link
Author

mrojas commented May 27, 2014

I'll make a PR then :)

@kartikthapar
Copy link

I would love to have this feature as well.

@mrojas Is there an update on the PR?

@jessesquires jessesquires added this to the Release 6.2.0 milestone Dec 27, 2014
@jessesquires
Copy link
Owner

All -- I've added this to the 6.2.0 milestone

@kartikthapar
Copy link

That's great. Thanks.

werediver pushed a commit to werediver/JSQMessagesViewController that referenced this issue Apr 25, 2015
…ut engine fault on iOS 7.x fixed.

The problem itself can be observed when the pull request jessesquires#726 is applyed on top of v7.0.1+.
jessesquires added a commit that referenced this issue May 13, 2015
jessesquires added a commit that referenced this issue May 13, 2015
…umInputToolbarHeight to toolbar class.
@samyakjain
Copy link

I tried everything but input text field height doesn't increase when a longer text is typed in. How can i solve this issue? I am on ios 9.

@danaelisanicolas
Copy link

Hi! I'm getting the same issue as @samyakjain, how can i increase the height of the input toolbar? thanks! Also on iOS 9

@samyakjain
Copy link

@thesleepycow I guess you forgot to call the method in baseview , call [super ...]

@danaelisanicolas
Copy link

@samyakjain sorry but i don't quite understand what you mean.. I'm trying in swift with this code

  self.inputToolbar?.maximumHeight = 500

@samyakjain
Copy link

i have done it in objective-c , you might be overriding this function,

  • (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)

make sure you call
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];

@danaelisanicolas
Copy link

oh! it's working now. Thank you very much!

@samosys-ror
Copy link

hello @samyakjain in which class and place i will call this method [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants