iOS 切换视图 DVSwitch

软件介绍

DVSwitch 是可定制的,基于 UISwitch 和 UISegmentedControl 的控件,使用 Objective-C 编写。

DVSwitch 灵感来源于 UISwitch 和 UISegmentedControl,目标如下:

  • 简单定制非常漂亮的动画控件

  • 支持拖动或者点击交互

  • 启动要求非常低 ,不需要图片

  • 漂亮的字体颜色效果

  • 基于项数值自动调节

使用

DVSwitch *switcher = [[DVSwitch alloc] initWithStringsArray:@[@"First", @"Second"]];
switcher.frame = CGRectMake(20, 60, self.view.frame.size.width - 40, 34);
[self.view addSubview:switcher];
[switcher setPressedHandler:^(NSUInteger index) {

    NSLog(@"Did switch to index: %lu", (unsigned long)index);

}];
[self.view addSubview:switcher];

可定制属性:

  • UIColor *backgroundColor - color of the controls background

  • UIColor *sliderColor - color of slider

  • UIColor *labelTextColorInsideSlider - color of text when slider hovers over it

  • UIColor *labelTextColorOutsideSlider - color of text when outside of slider

  • UIFont *font - font used in control

  • CGFloat cornerRadius - corner radius of control and corner radius of slider

  • CGFLoat sliderOffset - pixel offset in points between the slider and the edge of control




本文地址:https://codercto.com/soft/d/8892.html

爆品手记

爆品手记

金错刀 / 中国友谊出版公司 / 2016-9-20 / 39.80

互联网时代,一切都被颠覆。 B2B、B2C、O2O等商业模式的建立,对传统企业构成了巨大冲击。人们的生意往来逐渐从线下转移到了线上,传统的定位理论逐渐失效,依靠爆品引爆市场才是王道;传统企业经营多年的渠道营销模式正遭遇前所未有的阻力,网上商城正成为众多商家角逐血拼的主要战场。 在互联网的黑暗森林里,一切传统的商业模式统统失效,一场依靠爆品点燃市场、引爆市场、占据市场的营销革命正悄然兴起......一起来看看 《爆品手记》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

MD5 加密
MD5 加密

MD5 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具