【发布时间】:2017-01-26 15:22:54
【问题描述】:
我在 Xcode 8 中构建我的项目。UIPickerView 分隔线在 iOS 10 模拟器和设备中不可见,但在 iOS 9.3 设备和模拟器上工作正常。我试图在 XIB 中调整 UIPickerView 背景颜色、自动布局和所有可能的东西,但没有任何效果。有人对此有想法吗?
这是一个包含 UIPickerView 的自定义视图
-(void)layoutSubviews{
isShown = NO;
[super layoutSubviews];
//self.selectedDic = nil;
self.doneBtn.tintColor = COLOR_DB3535;
self.pickerView.backgroundColor = COLOR_DEDEDE;
self.pickerView.showsSelectionIndicator = YES;
[self.doneBtn setTitle:NSLocalizedString(@"App_Generic_Button_Text_Done", @"")];
}
-(UIView*)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
label.tintColor = [UIColor clearColor];
label.backgroundColor = [UIColor yellowColor];
label.textColor = COLOR_666;
label.font = [FontsManager getFONT_ROBOTO_LIGHT_16];
label.textAlignment = NSTextAlignmentCenter;
NSDictionary *dict = [dataArray objectAtIndex:row];
label.text = @"Test";
return label;
}
【问题讨论】:
-
我在我的 react-native 应用程序中使用选择器。我不需要显示选择器边界线。我怎样才能删除它? stackoverflow.com/posts/comments/108759438?noredirect=1
标签: ios objective-c uipickerview ios10 xcode8