pickerView

作者: iOS_Cqlee | 来源:发表于2015-10-04 00:30 被阅读616次

    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

    相关文章

      网友评论

        本文标题:pickerView

        本文链接:https://www.haomeiwen.com/subject/hqugcttx.html