您的位置:首页 > 其它

git实战(1)--git简介

2015-07-09 19:02 211 查看
#import <Foundation/Foundation.h>

@interface MySlider : UISlider {
}

@end


#import "MySlider.h"

@implementation MySlider

- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];

return self;
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
CGRect t = [self trackRectForBounds: [self bounds]];
float v = [self minimumValue] + ([[touches anyObject] locationInView: self].x - t.origin.x - 4.0) * (([self maximumValue]-[self minimumValue]) / (t.size.width - 8.0));
[self setValue: v];
[super touchesBegan: touches withEvent: event];
}

@end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: