GithubHelp home page GithubHelp logo

cctextview's Introduction

CCTextView

A UITextView which support placehold and dynamic height

基于UITextView封装的一个输入组件。支持自适应高度

Screenshot

img

Usage

create CCTextView like a UIView

self.ccTextView = [[CCTextView alloc]initWithFrame:CGRectMake(10, 20, 200, 34)];
//set property
[self.ccTextView setPlaceholderOpacity:.5];
[self.ccTextView setPlaceholderColor:[UIColor orangeColor]];
[self.ccTextView setPlaceholderFont:[UIFont boldSystemFontOfSize:15]];

//swich this property can change it dynamic height ablity,default is NO
self.ccTextView.shouldAutoUpdateHeight = YES;

Of course there are some events that callback

[self.ccTextView addTextViewBeginEvent:^(CCTextView *textView) {
    NSLog(@"CCTextView开始编辑");
}];

[self.ccTextView addTextViewEndEvent:^(CCTextView *textView) {
    NSLog(@"CCTextView结束编辑");
}];

[self.ccTextView TextViewDidUpdateHeightEvent:^(CCTextView *textView) {
    NSLog(@"CCTextView更新高度了%f",textView.frame.size.height);
}];

License

CCTextView is available under the MIT license. See the LICENSE file for more info.

cctextview's People

Contributors

jsaddnf avatar

Stargazers

a1anwang avatar  avatar deike avatar smile avatar  avatar  avatar yang ping avatar  avatar yfx avatar NUK avatar EvanTree avatar  avatar sx1huoying avatar  avatar  avatar cb avatar

Watchers

James Cloos avatar  avatar

cctextview's Issues

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.