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

 
110 楼:  发表于: 2011-11-11 14:32    发自: Web Page
图像及动画处理六:选取器(dataPicker仿苹果)

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

单行,横向放置,大小可配置,内容可配置且方法简单,同时可容纳文字和图片
(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/iphonedev/sdk/2011/1110/3483.html





[url=job.php?action=download&aid=26420][/url]

posted @ 2015-12-24 09:22  Bo-tree  阅读(78)  评论(0)    收藏  举报