Giter Site home page Giter Site logo

zhaddresstextfiled's Introduction

ZHAddressTextFiled

这个输入框是输入把默认提示语上移,我记得有第三方库,但是我就想造轮子,所以就除了这个。

现在支持以下:

  • 输入框四种状态
  • 输入自动显示正确的类型
  • 自动显示错误的提示
  • 可扩展
  • 支持Cocoapods

输入框四种状态:

  1. 默认状态:ATFVEditStateNormal

    显示输入框提示语 分割线暗色

  2. 编辑状态:ATFVEditStateEditing

    默认的提示语上移上面 分割线高亮

  3. 编辑完成:ATFVEditStateEdited

  4. 显示错误的提示语:ATFVEditStateEditedError

安装

  1. 直接下载github的库 拖拽ZHAddressTextFiled文件包到工程

  2. 使用cocoapods安装

    pod ZHAddressTextFiled

怎么使用

新建一个输入框样式表

ZHAddressTextFiledViewStyle *style = [[ZHAddressTextFiledViewStyle alloc] init]

你可以在样式表配置自己喜欢的样式

初始化输入框

ZHAddressTextFiledView *addressView = [[ZHAddressTextFiledView alloc] initWithStyle:style frame:CGRectMake(20, 50, [UIScreen mainScreen].bounds.size.width - 40, 50)];

自定义验证错误信息

addressView.validateInputCorrectComplete = ^NSString *(NSString *inputText) {
        if (inputText.length <= 2) {
            return @"输入的长度必须大于2";
        }
        return nil;
    };

zhaddresstextfiled's People

Contributors

josercc avatar

Watchers

James Cloos avatar TigerWang avatar

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.