zoukankan      html  css  js  c++  java
  • [翻译] OCMaskedTextField

    OCMaskedTextField

    https://github.com/OmerCora/OCMaskedTextField

    Simple class to display dynamically masked textFields

    这是一个简单的类,用来动态的给textFields设置输入文本的特殊限制.

    Usage

    To use OCMaskedTextFieldView, simply initialize the view with the desired format/mask string.

    为了使用OCMaskedTextFieldView,你可以初始化view的时候给定一个输入模板.

    
    OCMaskedTextFieldView *textField = [[OCMaskedTextFieldView alloc]
                                            initWithFrame:CGRectMake(20, 94, 280, 33)
                                            andMask:@"TR - #### #### #### #### #### ####"
                                            showMask:YES];
    
    

    Default mask supports 3 character sets and is expandable. Hardcoded values are also supported on the masks.

    默认的mask支持3种风格.当然也支持复杂的风格哦。

    //Default special mask characters:
    '#' : Numeric Values
    '&' : Alphanumeric Values
    '?' : Letter Values
    

    Sample Mask Strings,

    作为mask用的字符串,

    //IBAN: @"TR - #### #### #### #### #### ####"
    
    //Phone Number: @"+90 (###) ### ## ##"
    
    //Serial Number: @"[&&&&]-[&&&&]-[&&&&]-[&&&&]"
    
    // Name: @"Mr/Mrs. ?????????????"
    

    Blank values can also be set manually for each speacial character. (default is "_")

    当然,空格键值可以手动设置成其他特殊字符。

    [textField setNumericBlank:@"  " alphanumericBlank:@"  " letterBlank:@"  "];
    [textField showMask];
    

    License

    Licensed under the Apache License, Version 2.0 See Details:http://www.apache.org/licenses/LICENSE-2.0.html

  • 相关阅读:
    小阳买水果
    单调队列+dp
    最长的合法序列(栈+dp)
    A. 打印收费
    数位dp(K好数)
    Floyd(选地址)
    最短路计数
    线段树维护区间01
    解密(拓展欧几里的)
    树、森林的遍历
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/4730934.html
Copyright © 2011-2022 走看看