iOS 实现类似安卓的 九宫格 手势锁 组件

来源:互联网 发布:网络黑白 花无涯 在线 编辑:程序博客网 时间:2024/05/17 03:51

先看效果:


该组件中,可自定义九宫格的所有UI表现,自己DIY出想要的九宫格样子---组件地址:《http://download.csdn.net/detail/shuangyu1989/6799351》

注:以前也传过这个组件,之前做的有些类似草稿,因为要赶项目进度,最近有空把这个组件完善了一下,也提供了很多自定义UI的属性和接口

头文件中接口和属性具体如下:

#import <UIKit/UIKit.h>@class ITTLockView;@protocol ITTLockViewDelegate <NSObject>@optional- (void)lockView:(ITTLockView *)lockView didSelectedCircleAtIndex:(NSInteger)index;- (void)touchesEnd:(ITTLockView *)lockView;@end@interface ITTLockView : UIImageView//@property (nonatomic, retain) UIImage *selectedImage;@property (nonatomic, retain) UIColor *lineColor;@property (nonatomic, retain) UIImage *selectedImage4FalseState;@property (nonatomic, retain) UIColor *lineColor4FalseState;@property (nonatomic, assign) NSInteger lineWidth;// 设置是否能跳点连接@property (nonatomic, assign) BOOL canSkipConnect;// @property (nonatomic, retain) NSMutableArray *selectedIndexs;// @property (nonatomic, assign) id<ITTLockViewDelegate> delegate;//@property (nonatomic, assign) BOOL currentState;//@property (nonatomic, assign) BOOL touchesEnabled;- (id)initWithFrame:(CGRect)frame circleRadius:(float)radius circleColor:(UIColor *)color circleThickness:(float)thickness circleFillColor:(UIColor *)fillColor;- (id)initWithFrame:(CGRect)frame circleRadius:(float)radius circleColor:(UIColor *)color circleThickness:(float)thickness;- (id)initWithFrame:(CGRect)frame circleRadius:(float)radius circleColor:(UIColor *)color;- (void)resetInterface;@end




1 0