//移除选中行黑色边框。
for (UIView *view in timeView.pickerView.subviews) {
NSLog(@"~~~~%@", view);
}
得出结果:
2016-01-14 13:18:35.074 SuperWallet_Personal[4695:134090] ~~~~<UIView: 0x7fe773d72810; frame = (0 0; 274.667 155.75); layer = <CALayer: 0x7fe773d945b0>>
2016-01-14 13:18:35.075 SuperWallet_Personal[4695:134090] ~~~~<UIView: 0x7fe776104c90; frame = (0 50.3333; 274.667 0.666667); layer = <CALayer: 0x7fe773fdc7e0>>
2016-01-14 13:18:35.075 SuperWallet_Personal[4695:134090] ~~~~<UIView: 0x7fe776104e00; frame = (0 105; 274.667 0.666667); layer = <CALayer: 0x7fe773fdc280>>
通关观察有3个UIView
而我们要移除的是两个线
所以显而易见 线的height = 0.67
所以
for (UIView *view in timeView.pickerView.subviews) {
NSLog(@"~~~~%@", view);
if (view.frame.size.height < 2) {
[view removeFromSuperview];
}
}