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

    DZNSegmentedControl

    A drop-in replacement for UISegmentedControl for showing counts, to be used typically on a user profile.

    一个UISegmentedControl的子类,用以扩展UISegmentedControl的功能,可以用在展示用户的信息上.

    Features

    • Customizable control with tint color, font, sizes and animation duration. 可以定制填充颜色,字体,尺寸以及动画的方向
    • Animated and width auto-adjusting selection indicator. 可以做动画以及自动适应.
    • UIBarPositioning support. 支持UIBarPositioning
    • UIAppearance support. 支持UIAppearance
    • ARC & 64bits. ARC 以及 64位

    Installation

    Available in Cocoa Pods

    你可以使用Cocoa Pods安装

    pod 'DZNSegmentedControl'
    

    How to use

    For complete documentation, visit CocoaPods' auto-generated doc

    你可以参考文档 visit CocoaPods' auto-generated doc

    Step 1

    Import "DZNSegmentedControl.h"
    导入头文件

    Step 2

    Creating a new instance of DZNSegmentedControl is very similar to what you would do with UISegmentedControl:

    创建出 DZNSegmentedControl 对象,与创建 UISegmentedControl 类似:

    NSArray *items = @[@"Tweets", @"Following", @"Followers"];
    
    DZNSegmentedControl *control = [[DZNSegmentedControl alloc] initWithItems:items];
    control.tintColor = [UIColor blueColor];
    control.delegate = self;
    control.selectedSegmentIndex = 1;
    
    [control addTarget:self action:@selector(selectedSegment:) forControlEvents:UIControlEventValueChanged];
    

    You can additionally set more properties:

    你还可以设置额外的一些属性:

    [control setCount:@(12) forSegmentAtIndex:0];
    [control setTitle:@"Hello" forSegmentAtIndex:1];
    [control setEnabled:NO forSegmentAtIndex:2];
    

    Sample project

    Take a look into the sample project. Everything is there.

    你也可以参考一下示例项目.

     

  • 相关阅读:
    快捷键打开远程桌面
    织梦Dedecms后台登陆密码忘记怎么办?
    Windows curl开启注意事项
    Composer教程
    composer.json和composer.lock有什么区别?
    Web.config 文件例子
    win10回收站右键有2个“CCleaner”怎么删除
    sublime快捷键
    Json 文件注意事项
    加入购物车流程
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/4532795.html
Copyright © 2011-2022 走看看