This commit is contained in:
lianxiang
2018-10-12 09:12:54 +08:00
parent dc1b1e330f
commit 97af177b88
37 changed files with 583 additions and 173 deletions
@@ -23,8 +23,18 @@
{
self = [super init];
if (self) {
[self thumbimageView];
[self createUI];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self thumbimageView];
[self createUI];
}
return self;
}
@@ -34,16 +44,15 @@
- (NYPopover *)popover
{
if (_popover == nil) {
if (_popover == nil){
//Default size, can be changed after
[self addTarget:self action:@selector(updatePopoverFrame) forControlEvents:UIControlEventValueChanged];
_popover = [[NYPopover alloc] initWithFrame:CGRectMake(self.frame.origin.x, self.frame.origin.y - 32, 40, 32)];
[self updatePopoverFrame];
_popover.alpha = 0;
[self.superview addSubview:_popover];
[self thumbimageView];
[self createUI];
// [self thumbimageView];
// [self createUI];
}
return _popover;
@@ -52,7 +61,8 @@
- (void)setValue:(float)value
{
[super setValue:value];
[self updatePopoverFrame];
//[self updatePopoverFrame];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
@@ -157,8 +167,10 @@
self.minimumValue = 0.0;
self.maximumValue = 1.0;
self.minimumTrackTintColor = GIGARGB(216,216, 216, 1);
self.maximumTrackTintColor = GIGARGB(216,216, 216, 1);
// self.minimumTrackTintColor = GIGARGB(216,216, 216, 1);
// self.maximumTrackTintColor = GIGARGB(216,216, 216, 1);
self.minimumTrackTintColor = GIGAUIColorFromRGBA(0xEA4D4D);
self.maximumTrackTintColor = GIGAUIColorFromRGBA(0xEA4D4D);
}
@@ -171,6 +183,8 @@
return bounds;
}
-(void)thumbimageView{
[self setThumbImage:[self OriginImage:[UIImage imageNamed:@"btn_slider_thumb"] scaleToSize:CGSizeMake(40, 40)] forState:UIControlStateNormal];
@@ -236,7 +250,6 @@
if ((point.x >= _lastBounds.origin.x - thumbBound_x) && (point.x <= (_lastBounds.origin.x + _lastBounds.size.width + thumbBound_x)) && (point.y < (_lastBounds.size.height + thumbBound_y))) {
result = YES;
}
}
return result;
}