UIPickerView

2020-06-10  本文已影响0人  贝灬小晖

UIPickerView 设置选中的颜色

其实用到的还是两个代理方法

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
}

-(UIView )pickerView:(UIPickerView )pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
}

只是didSelectRow完成的时候 记得刷新

[_pickerView reloadAllComponents];

根据选中的 component row 来确定

上一篇 下一篇

猜你喜欢

热点阅读