01-pickerView简单使用
一.UIPickerViewDataSource
// 返回有多少列- (NSInteger)numberOfComponentsInPickerView:(UIPickerView*)pickerView;// 返回第component有多少行- (NSInteger)pickerView:(UIPickerView*)pickerView numberOfRowsInComponent:(NSInteger)component;
二.UIPickerViewDelegate
// 返回第component列多宽- (CGFloat)pickerView:(UIPickerView*)pickerView widthForComponent:(NSInteger)component
// 返回第component列多高- (CGFloat)pickerView:(UIPickerView*)pickerView rowHeightForComponent:(NSInteger)component
// 返回第component列第row行标题- (NSString*)pickerView:(UIPickerView*)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
// NSAttributedString:富文本,可以描述文本的外观属性,颜色,字体,阴影,空心,图文混排//- (NSAttributedString *)pickerView:(UIPickerView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)component
// 返回第component列第row行视图控件- (UIView*)pickerView:(UIPickerView*)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView*)view
// 当用户选中某一行的时候调用// 选中第component列第row行的时候调用// 可以监听pickerView滚动- (void)pickerView:(UIPickerView*)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
网友评论