在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):JunichiT/JTMaterialSwitch开源软件地址(OpenSource Url):https://github.com/JunichiT/JTMaterialSwitch开源编程语言(OpenSource Language):Objective-C 98.7%开源软件介绍(OpenSource Introduction):Overview
This library has cool and sophisticated animations, ripple effect and bounce effect. Also, customizable properties can be tweaked behaviors and enhance your application UI cool. With this library, you can easily implement material design switch to your app. Installation
You can use this library by adding the following command onto your Podfile: pod "JTMaterialSwitch" UsageThe simplest setup: JTMaterialSwitch *switch = [[JTMaterialSwitch alloc] init];
switch.center = CGPointMake(200, 200);
[self.view addSubview:switch]; This is the simplest and easiest initialization.
The style, size and initial state of In addition, this library also has following designated initializers to set these parameters. /**
* Initializes a JTMaterialSwitch with a initial switch state position and size.
*
* @param size A JTMaterialSwitchSize enum as this view's size(big, normal, small)
* @param state A JTMaterialSwitchState enum as this view's initial switch pos(ON/OFF)
*
* @return A JTMaterialSwitch with size and initial position
*/
- (id)initWithSize:(JTMaterialSwitchSize)size state:(JTMaterialSwitchState)state;
/**
* Initializes a JTMaterialSwitch with a initial switch size, style and state.
*
* @param size A JTMaterialSwitchSize enum as this view's size(big, normal, small)
* @param state A JTMaterialSwitchStyle enum as this view's initial style
* @param state A JTMaterialSwitchState enum as this view's initial switch pos(ON/OFF)
*
* @return A JTMaterialSwitch with size, style and initial position
*/
- (id)initWithSize:(JTMaterialSwitchSize)size style:(JTMaterialSwitchStyle)style state:(JTMaterialSwitchState)state; Customize BehaviorsJTMaterialSwitch has many prateters to customize behaviors as you like. Style and size
Properties#pragma State
/** A Boolean value that represents switch's current state(ON/OFF). YES to ON, NO to OFF the switch */
@property (nonatomic) BOOL isOn;
/** A Boolean value that represents switch's interaction mode. YES to set enabled, No to set disabled*/
@property (nonatomic) BOOL isEnabled;
/** A Boolean value whether the bounce animation effect is enabled when state change movement */
@property (nonatomic) BOOL isBounceEnabled;
/** A Boolean value whether the ripple animation effect is enabled or not */
@property (nonatomic) BOOL isRippleEnabled;
#pragma Color
/** An UIColor property to represent the color of the switch thumb when position is ON */
@property (nonatomic, strong) UIColor *thumbOnTintColor;
/** An UIColor property to represent the color of the switch thumb when position is OFF */
@property (nonatomic, strong) UIColor *thumbOffTintColor;
/** An UIColor property to represent the color of the track when position is ON */
@property (nonatomic, strong) UIColor *trackOnTintColor;
/** An UIColor property to represent the color of the track when position is OFF */
@property (nonatomic, strong) UIColor *trackOffTintColor;
/** An UIColor property to represent the color of the switch thumb when position is DISABLED */
@property (nonatomic, strong) UIColor *thumbDisabledTintColor;
/** An UIColor property to represent the color of the track when position is DISABLED */
@property (nonatomic, strong) UIColor *trackDisabledTintColor;
/** An UIColor property to represent the fill color of the ripple only when ripple effect is enabled */
@property (nonatomic, strong) UIColor *rippleFillColor;
Change History1.1 Bug Fix 1.0.0 Initial Release RequirementsiOS 7.0 or later AuthorJunichi Tsurukawa [email protected] LicenseJTMaterialSwitch is available under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论