您的位置:首页 > 其它

图像及动画处理六:选取器(dataPicker仿苹果)

2011-11-10 13:17 393 查看
本文由论坛会员bimeteorf分享

实现了苹果的选取器,与苹果自带的选取器相比有以下特点:

单行,横向放置,大小可配置,内容可配置且方法简单,同时可容纳文字和图片
(1) tasks:

-(id)initWithFrame:(CGRect)frame array:(NSArray*)list row:(int)aRow;

-(int)index;
(2)discussions:

1)-(id)initWithFrame:(CGRect)frame array:(NSArray*)list row:(int)aRow;

arguments:

frame: the frame of the component view

list: the content listed on the component view, in format of NSString and UIImage only

row: the number of row displaying on the component, limited to be 1,3,5 and 7 only

return value: a subclass of UIView
2)-(int)index;

return value: to indicate which section is chosen.
(3)attentions:

the background image is in the format "png", so it may looks ugly when scaling it

or setting its frame some times. when that happens, it is suggested to rescale it or

change the image in the file "bg.png"
效果如图:



原帖地址:http://www.cocoachina.com/bbs/read.php?tid=66614

源码下载:





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