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

    TLTagsControl

    https://github.com/ali312/TLTagsControl#tltagscontrol

    A nice and simple tags input control for iOS.

    You are able to easily setup different colors for control elements and set different displaying modes

    一个简单的便签控件.

    你可以很容易的给便签设置不同的颜色或者是不同的显示样式.

     

    Switching between displaying modes

    在不同的样式中切换

    You are able to switch between displyaing modes by setting the mode property

    你可以用mode属性来设置便签的显示样式.

    @property (nonatomic) TLTagsControlMode mode;

    TLTagsControl has two displaying modes

    TLTagsControl有两种显示样式

    TLTagsControlModeEdit,
    

    This mode allows user to input new tags and delete tags that are already presented.

    In this mode control will look like below:

    一种有取消"x"标志的样式,看起来效果如下:

    TLTagsControlModeList,
    

    This mode allows only listing of already presented tags

    In this mode control will look like below:

    一种是纯粹显示文本的效果,如下:

    Setting different colors of control elements

    You are able to change colors of different element by setting these prperties

    你可以设置这个控件不同元素上面的颜色,比如字体颜色,背景色等

    @property (nonatomic, strong) UIColor *tagsBackgroungColor;
    @property (nonatomic, strong) UIColor *tagsTextColor;
    @property (nonatomic, strong) UIColor *tagsDeleteButtonColor;
    

    Applying changes

    To apply your changes you should call the method below

    如果要执行变化,请调用以下方法.

    - (void)reloadTagSubviews;
    
    Example:
    //assuming tagControl will be set initialized from stroryboard
    @interface ViewController ()
    
    @property (nonatomic, strong) IBOutlet TLTagsControl *tagControl;
    
    @end
    
    ....
    
    @implementation ViewController
    
    - (void)viewDidLoad {
      [super viewDidLoad];
    
      UIColor *blueBackgroundColor = [UIColor colorWithRed:75.0/255.0 green:186.0/255.0 blue:251.0/255.0 alpha:1];
      UIColor *whiteTextColor = [UIColor whiteColor];
    
      self.tagControl.tagsBackgroungColor = blueBackgroundColor;
      self.tagControl.tagsDeleteButtonColor = whiteTextColor;
      self.tagControl.tagsTextColor = whiteTextColor;
    
      self.tagControl.mode = TLTagsControlModeList;
    
      [self.tagControl reloadTagSubviews];
    }
    
    @end

  • 相关阅读:
    35个Java代码优化的细节,你知道几个?
    Java如何优雅地实现接口数据校验
    Java中方法的重载详解(含系统配套视频)
    七大经典、常用排序算法的原理、Java 实现以及算法分析
    Java静态方法和实例方法
    Java静态变量和实例变量
    “反转链表”相关的题目
    【C++】将十进制数转换为十六进制数
    第四章:动态规划I
    【C++】数组中的第k个最小元素
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/4518110.html
Copyright © 2011-2022 走看看