Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HansPinckaers/GrowingTextView
[UNMAINTAINED] An UITextView which grows/shrinks with the text and starts scrolling when the content reaches a certain number of lines. Similar to the one Apple uses in the SMS-app. See blog-post for a small screencast.
https://github.com/HansPinckaers/GrowingTextView
Last synced: 20 days ago
JSON representation
[UNMAINTAINED] An UITextView which grows/shrinks with the text and starts scrolling when the content reaches a certain number of lines. Similar to the one Apple uses in the SMS-app. See blog-post for a small screencast.
- Host: GitHub
- URL: https://github.com/HansPinckaers/GrowingTextView
- Owner: hanspinckaers
- License: mit
- Archived: true
- Created: 2011-08-05T17:37:18.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T05:54:55.000Z (over 6 years ago)
- Last Synced: 2024-05-17T11:01:37.317Z (6 months ago)
- Language: Objective-C
- Homepage: http://www.hanspinckaers.com/multi-line-uitextview-similar-to-sms
- Size: 604 KB
- Stars: 2,052
- Watchers: 85
- Forks: 454
- Open Issues: 71
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome - GrowingTextView - [UNMAINTAINED] An UITextView which grows/shrinks with the text and starts scrolling when the content reaches a certain number of lines. Similar to the one Apple uses in the SMS-app. See blog-post for a small screencast. (etc)
- awesome - GrowingTextView - [UNMAINTAINED] An UITextView which grows/shrinks with the text and starts scrolling when the content reaches a certain number of lines. Similar to the one Apple uses in the SMS-app. See blog-post for a small screencast. (etc)
README
HPGrowingTextView
=================Multi-line/Autoresizing UITextView similar as in the SMS-app. The example project mimicks the look of Apple's SMS-app.
![Screenshot](http://f.cl.ly/items/270f2F3q3d3q142m140A/ss.png)
Properties
----------```objective-c
int maxNumberOfLines; // Stops growing at this amount of lines.
int minNumberOfLines; // Starts growing at this amount of lines.
int maxHeight; // Specify the maximum height in points instead of lines.
int minHeight; // Specify the minimum height in points instead of lines.
BOOL animateHeightChange; // Animate the growing
NSTimeInterval animationDuration; // Adjust the duration of the growth animation.
```UITextView borrowed properties
----------------```objective-c
NSString *text;
UIFont *font;
UIColor *textColor;
NSTextAlignment textAlignment;
NSRange selectedRange;
BOOL editable;
UIDataDetectorTypes dataDetectorTypes;
UIReturnKeyType returnKeyType;
```If you want to set other UITextView properties, use .internalTextView
Delegate methods
---------------```objective-c
-(BOOL)growingTextViewShouldBeginEditing:(HPGrowingTextView *)growingTextView;
-(BOOL)growingTextViewShouldEndEditing:(HPGrowingTextView *)growingTextView;-(void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView;
-(void)growingTextViewDidEndEditing:(HPGrowingTextView *)growingTextView;-(BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
-(void)growingTextViewDidChange:(HPGrowingTextView *)growingTextView;// Called WITHIN animation block!
-(void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height;// Called after animation
-(void)growingTextView:(HPGrowingTextView *)growingTextView didChangeHeight:(float)height;-(void)growingTextViewDidChangeSelection:(HPGrowingTextView *)growingTextView;
-(BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView;
```For more info, see blogpost: http://www.hanspinckaers.com/multi-line-uitextview-similar-to-sms