目标c:使UIPickerView分隔线不可见

时间:2018-06-30 13:12:03

标签: objective-c uipickerview

我用以下代码创建一个pickerView(分隔线不可见):

pickerView = [[UIPickerView alloc]initWithFrame:CGRectMake(0, 40, [Functions Dwidth], 190)];
    pickerView.delegate = self;
    pickerView.dataSource = self;
    pickerView.layer.borderWidth = 0;
    [popupView addSubview:pickerView];
.
.
.

-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
    return 3;
}

-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
    return 10;
}

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

在我将此代码添加到我的项目分隔符行后,将可见:

[pickerView selectRow:3 inComponent:1 animated:NO];
[pickerView selectRow:2 inComponent:0 animated:NO];

我如何使其再次不可见?

0 个答案:

没有答案