Commit 3c1c73c5 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Add custom slider class

parent e198305c
//
// VLCSlider.h
// VLC for iOS
//
// Created by Felix Paul Kühne on 06.06.13.
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
#import "OBSlider.h"
@interface VLCOBSlider : OBSlider
@end
@interface VLCSlider : UISlider
@end
//
// VLCSlider.m
// VLC for iOS
//
// Created by Felix Paul Kühne on 06.06.13.
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
#import "VLCSlider.h"
@implementation VLCOBSlider
- (void)awakeFromNib
{
self.minimumValueImage = [UIImage imageNamed:@"sliderminiValue"];
self.maximumValueImage = [UIImage imageNamed:@"slidermaxValue"];
[self setMinimumTrackImage:[UIImage imageNamed:@"sliderminimumTrack"] forState:UIControlStateNormal];
[self setMaximumTrackImage:[UIImage imageNamed:@"slidermaximumTrack"] forState:UIControlStateNormal];
[self setThumbImage:[UIImage imageNamed:@"ballSlider"] forState:UIControlStateNormal];
[self setThumbImage:[UIImage imageNamed:@"knobSlider"] forState:UIControlStateHighlighted];
}
- (CGRect)trackRectForBounds:(CGRect)bounds
{
CGRect returnValue = [super trackRectForBounds:bounds];
returnValue.origin.x = 5.;
returnValue.origin.y = 7.;
returnValue.size.width = bounds.size.width - 10.;
return returnValue;
}
@end
@implementation VLCSlider
- (void)awakeFromNib
{
self.minimumValueImage = [UIImage imageNamed:@"sliderminiValue"];
self.maximumValueImage = [UIImage imageNamed:@"slidermaxValue"];
[self setMinimumTrackImage:[UIImage imageNamed:@"sliderminimumTrack"] forState:UIControlStateNormal];
[self setMaximumTrackImage:[UIImage imageNamed:@"slidermaximumTrack"] forState:UIControlStateNormal];
[self setThumbImage:[UIImage imageNamed:@"ballSlider"] forState:UIControlStateNormal];
}
- (CGRect)trackRectForBounds:(CGRect)bounds
{
CGRect returnValue = [super trackRectForBounds:bounds];
returnValue.origin.x = 5.;
returnValue.origin.y = 7.;
returnValue.size.width = bounds.size.width - 10.;
return returnValue;
}
@end
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment