UIPickerView_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > UIPickerView

UIPickerView

 2013/8/6 21:08:33  火红的云彩  博客园  我要评论(0)
  • 摘要:@protocolUIPickerViewDataSource<NSObject>@required//returnsthenumberof'columns'todispl返回piker的列数-(NSInteger)numberOfComponentsInPickerView:(UIPickerView*)pickerView;//returnsthe#ofrowsineachcomponent..返回每列的行数-(NSInteger)pickerView:
  • 标签:view
@protocol UIPickerViewDataSource<NSObject>
@required

// returns the number of 'columns' to displ   返回piker的列数
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView;

// returns the # of rows in each component..   返回每列的行数
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
@end


@protocol UIPickerViewDelegate<NSObject>
@optional

// returns width of column and height of row for each component. 设置每列的宽
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component;
//设置每列的高
- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component; // these methods return either a plain UIString, or a view (e.g UILabel) to display the row for the component. // for the view versions, we cache any hidden and thus unused views and pass them back for reuse. // If you return back a different object, the old one will be released. the view will be centered in the row rect
//设置每列的标题
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
//设置自定义空件的宽和高
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view; //选择时触发该时间 - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component; @end

 

上一篇: 通用汽车智能战略:全面开放汽车数据 下一篇: 没有下一篇了!
发表评论
用户名: 匿名