Giter VIP home page Giter VIP logo

remind101 / growingtextview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hanspinckaers/growingtextview

1.0 70.0 2.0 475 KB

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.

Home Page: http://www.hanspinckaers.com/multi-line-uitextview-similar-to-sms

License: MIT License

Ruby 1.53% Objective-C 95.34% C++ 3.13%

growingtextview's Introduction

HPGrowingTextView

Multi-line/Autoresizing UITextView similar as in the SMS-app. The example project mimicks the look of Apple's SMS-app.

Screenshot

Properties

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

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

-(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

growingtextview's People

Contributors

hanspinckaers avatar rex-remind101 avatar mattjgalloway avatar hanishabsigh avatar alexeys avatar mattrubin avatar allewun avatar dav avatar d-ross avatar agnat avatar dimavartanian avatar euanlau avatar egoldfarb avatar jagreenwood avatar johnpaulmanoza avatar ramgreenberg avatar srandazzo avatar delackner avatar palringosteve avatar bretdabaker avatar danpe avatar timmehmainframe avatar

Stargazers

Kaweh Kazemi avatar

Watchers

Matt Rubens avatar Ben Marini avatar Turadg Aleahmad avatar David Lyons avatar Jesse Montrose avatar Sanjay avatar Eric Holmes avatar Joshua Carver avatar Chris Gutierrez avatar Sean Conaty avatar Danny Roa avatar  avatar  avatar Peter Hamilton avatar Quenton Longmire Cook avatar  avatar Dustin Horton avatar Josh Holtz avatar Vlad Yarotsky avatar Michael Barrett avatar Tim White avatar wrmsr avatar Taylor avatar Aditya Bansod avatar Amanda Canyon avatar Harry Tormey avatar James Cloos avatar Dirk avatar  avatar Zach Abrams avatar max avatar Hemant Bhonsle avatar  avatar Jessie avatar Cameron Reynolds-Flatt avatar  avatar Anbu avatar  avatar Jeff Pierce avatar  avatar Quentin Cuvillier avatar Rodrigo Manubens avatar Elaine Zhou avatar Jason Loo avatar  avatar Gabriel Wong avatar Prakash Sanker avatar  avatar  avatar Benjamin Grol avatar Joseph Lee avatar Jordan DiSanto avatar  avatar James McMath avatar Mahimna Dave avatar  avatar  avatar Peter Socha avatar Ryan Phillips avatar  avatar  avatar Emily McDonnell avatar Melanie Boeckmann avatar Andrew Zhou avatar R.ichard.Di avatar Tony Wang avatar Nikki Coll avatar Brian Addison avatar  avatar  avatar

Forkers

podkovyrin vvit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.