UIPickerView selection indicator not visible in iOS10

前端 未结 7 2138
刺人心
刺人心 2021-02-04 06:01

I build my project in Xcode 8. UIPickerView separator lines are not visible in iOS 10 simulator and the devices, but works fine on iOS 9.3 devices and simulator. I tried to adju

7条回答
  •  时光取名叫无心
    2021-02-04 06:28

    This is my code:

    -(UIView*)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
    
        for(UIView *single in pickerView.subviews)
        {
            if (single.frame.size.height < 1)
            {
                single.backgroundColor = [UIColor grayColor];
            }
        }
       //other code
    
    }
    

提交回复
热议问题