danielamitay / daanisotropicimage Goto Github PK
View Code? Open in Web Editor NEWDAAnisotropicImage is an anisotropic UIImage generator. Specifically, for a metallic slider knob.
License: Other
DAAnisotropicImage is an anisotropic UIImage generator. Specifically, for a metallic slider knob.
License: Other
A suggestion: avoid images completely, and use https://github.com/galaxas0/Core-Graphics-Additions to draw the conical gradients required for the slider. Would this increase overhead?
The slider with DAAnisotrapicImage is working perfectly but when I put the slider in a UIToolbar the thumbImage appears a bit too low. You can see an example here: https://www.dropbox.com/s/f2d37xi2i54syae/Screen%20Shot%202012-09-02%20at%2019.09.03.png
I'm not really sure that this is an issue with DAAnisotropicImage but the previous default slider that I used did not have this problem.
The code that I use to customize the UISlider view inside a MPVolumeView:
-(void) customizeSlider{
MPVolumeView *volumeView = self.volumeView;
NSArray *tempArray = volumeView.subviews;
for (id current in tempArray){
if ([current isKindOfClass:[UISlider class]]){
self.tempSlider = (UISlider *) current;
self.tempSlider.frame = CGRectMake(20.0f, 180.0f, 280.0f, 40.0f);
UIImage *stretchableFillImage = [[UIImage imageNamed:@"slider-fill"] resizableImageWithCapInsets:UIEdgeInsetsMake(0.0f, 6.0f, 0.0f, 6.0f)];
UIImage *stretchableTrackImage = [[UIImage imageNamed:@"slider-track"] resizableImageWithCapInsets:UIEdgeInsetsMake(0.0f, 6.0f, 0.0f, 6.0f)];
[self.tempSlider setMinimumTrackImage:stretchableFillImage forState:UIControlStateNormal];
[self.tempSlider setMaximumTrackImage:stretchableTrackImage forState:UIControlStateNormal];
UIImage *initialImage = [DAAnisotropicImage imageFromAccelerometerData:nil];
[self.tempSlider setThumbImage:initialImage forState:UIControlStateNormal];
[self.tempSlider setThumbImage:initialImage forState:UIControlStateHighlighted];
[self.tempSlider setThumbImage:[UIImage imageNamed:@"thumbImage.png"] forState:UIControlStateNormal];
}
}
//start updating image
[DAAnisotropicImage startAnisotropicUpdatesWithHandler:^(UIImage *image) {
[self.tempSlider setThumbImage:image forState:UIControlStateNormal];
[self.tempSlider setThumbImage:image forState:UIControlStateHighlighted];
}];
[self.volumeView removeFromSuperview];
[self.view addSubview:volumeView];
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.