// // CCUISlider.m // CCFC // // Created by xichen on 11-12-28. // Copyright 2011 ccteam. All rights reserved. // #import "CCUISlider.h" @implementation UISlider(cc) // create a common UISlider + (UISlider *)createCommonSlider:(CGRect)rect target:(id)target sel:(SEL)sel { UISlider *slider = [[UISlider alloc] initWithFrame:rect]; if(slider == nil) return nil; slider.minimumValue = 0; slider.maximumValue = 100; [slider addTarget:target action:sel forControlEvents:UIControlEventValueChanged]; return [slider autorelease]; } @end
可能有更新:
googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUISlider.m
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCUISlider.m
本文介绍了如何使用CCUISlider创建一个通用的滑块控件,并设置了其最小和最大值,以及目标和动作,以便在滑动条改变值时触发相应的事件。
77

被折叠的 条评论
为什么被折叠?



