详解iOS App中UIPickerView滚动选择栏的添加方法
1.UIPickerView的宽度和高度是固定的,纵向是320216,横向是568162
2.属性:
@property(nonatomic,readonly)NSIntegernumberOfComponents;//选择框的行数
@property(nonatomic,assign)idUIPickerViewDataSource>dataSource;(类似于UITableView)
@property(nonatomic,assign)idUIPickerViewDelegate>delegate;(类似于UITableView)
(BOOL)showsSelectionIndicator//是否显示选择指示器,即是一个蓝色的条
pickerView=[[UIPickerViewalloc]initWithFrame:CGRectMake(0,0,320,216)]; // 指定Delegate pickerView.delegate=self; // 显示选中框 pickerView.showsSelectionIndicator=YES; [self.viewaddSubview:pickerView];