1.有几组
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
2.每组有几行
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
3.显示内容
- (UIView *)pickerView:(UIPickerView *)pickerView
viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
4.滚动到某行做什么
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
5.view的高度
- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component
6.view的宽度
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component
本文详细解析了iOS开发中UIPickerView的基本组件和操作方法,包括获取组件数量、每组行数、显示内容、滚动到指定行、高度和宽度等,帮助开发者深入掌握UIPickerView的使用技巧。

227

被折叠的 条评论
为什么被折叠?



