Latest 2.1.1
Homepage https://github.com/804145113/PrettyRuler
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit, QuartzCore
Authors

一个漂亮的横向刻度尺自定义控件,用CAShapeLayer实现高效GPU渲染,没有用一张图片!
控件两边添加渐变透明效果,看起来更加自然。使用方法具体看demo,简单易懂,几句代码搞定,但是该自定义控件只支持代码方式创建。

说明

iOS7 +,刻度选择支持选择0值,为最小模式,不能选择0值时候,为正常模式,具体请看最下面效果图。

支持pod安装

pod ‘PrettyRuler’, ‘~> 2.1.1’

用法

  1. 拖拽class文件夹到你的项目
  2. 在你的控制器里导入 TXHRrettyRuler.h
  3. 类似以下这段代码
    TXHRrettyRuler ruler = [[TXHRrettyRuler alloc] initWithFrame:CGRectMake(20, 220, [UIScreen mainScreen].bounds.size.width – 20 2, 140)];
    ruler.rulerDeletate = self;
    [ruler showRulerScrollViewWithCount:200 average:1 currentValue:36.5f smallMode:YES];
    [self.view addSubview:ruler];

效果图

1.最小模式也就是当smallMode = yes。

Smaller icon

2.正常模式也就是smellmode = no。

Smaller icon

Latest podspec

{
    "name": "PrettyRuler",
    "version": "2.1.1",
    "summary": "u4e00u4e2au6f02u4eaeu7684u6a2au5411u523bu5ea6u5c3au81eau5b9au4e49u63a7u4ef6uff0cu7528CAShapeLayeru5b9eu73b0u9ad8u6548GPUu6e32u67d3",
    "description": ""CAShapeLayeru5b9eu73b0u9ad8u6548GPUu6e32u67d3uff0cu6f02u4eaeu7684u81eau5b9au4e49u6a2au5411u76f4u5c3au63a7u4ef6uff0ciOS7u4ee5u4e0auff0cu523bu5ea6u6700u5c0fu7cbeu5ea60.1uff0cu4e0du8db30.5u65f6u81eau51cfuff0cu5927u4e8e0.5u65f6u81eau589e"",
    "homepage": "https://github.com/804145113/PrettyRuler",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "AsTryE": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/804145113/PrettyRuler.git",
        "tag": "2.1.1"
    },
    "source_files": "PrettyRuler/PrettyRulerClass/*",
    "public_header_files": "PrettyRuler/PrettyRulerClass/*.h",
    "frameworks": [
        "UIKit",
        "QuartzCore"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This