我一直在研究信用卡选项的uidatepicker视图,我很好奇是否有可能从UIDatePickerView的子视图中删除特定视图?
我遍历UIDatePickerView并得到了这样的内容:
sub an views <UIView: 0x5bb55d0; frame = (0 0; 320 216); autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbaf00>>
2011-12-13 17:56:34.205 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbbda0; frame = (20 86; 1 48); opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x5bbbe20>>
2011-12-13 17:56:34.206 test[7615:207] sub an views <_UIPickerWheelView: 0x5bbd840; frame = (21 0; 150 216); autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbd8c0>>
2011-12-13 17:56:34.207 test[7615:207] sub an views <_UIPickerViewSelectionBar: 0x5bbb430; frame = (21 86; 150 44); userInteractionEnabled = NO; layer = <CALayer: 0x5bbbdd0>>
2011-12-13 17:56:34.208 test[7615:207] sub an views <UIPickerTable: 0x5bbdd90; frame = (21 0; 146 216); clipsToBounds = YES; opaque = NO; autoresize = W+TM+H; layer = <CALayer: 0x5bbdcf0>>
2011-12-13 17:56:34.208 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbbd60; frame = (21 0; 150 216); opaque = NO; autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbd920>>
2011-12-13 17:56:34.209 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbbf30; frame = (21 86; 150 62); opaque = NO; autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbdfe0>>
2011-12-13 17:56:34.210 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbe7f0; frame = (171 86; 2 48); opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x5bbe820>>
2011-12-13 17:56:34.211 test[7615:207] sub an views <_UIPickerWheelView: 0x5bbe870; frame = (173 0; 48 216); autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbe8a0>>
2011-12-13 17:56:34.212 test[7615:207] sub an views <_UIPickerViewSelectionBar: 0x5bbe8d0; frame = (173 86; 48 44); userInteractionEnabled = NO; layer = <CALayer: 0x5bbe900>>
2011-12-13 17:56:34.212 test[7615:207] sub an views <UIPickerTable: 0x5bbe930; frame = (173 0; 44 216); clipsToBounds = YES; opaque = NO; autoresize = W+TM+H; layer = <CALayer: 0x5bbeb10>>
2011-12-13 17:56:34.213 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbec10; frame = (173 0; 48 216); opaque = NO; autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbebe0>>
2011-12-13 17:56:34.214 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbed90; frame = (173 86; 48 62); opaque = NO; autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbedc0>>
2011-12-13 17:56:34.214 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbee30; frame = (221 86; 2 48); opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x5bbee60>>
2011-12-13 17:56:34.215 test[7615:207] sub an views <_UIPickerWheelView: 0x5bbee90; frame = (223 0; 76 216); autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbeec0>>
2011-12-13 17:56:34.216 test[7615:207] sub an views <_UIPickerViewSelectionBar: 0x5bbeef0; frame = (223 86; 76 44); userInteractionEnabled = NO; layer = <CALayer: 0x5bbef20>>
2011-12-13 17:56:34.217 test[7615:207] sub an views <UIPickerTable: 0x5bbef50; frame = (223 0; 72 216); clipsToBounds = YES; opaque = NO; autoresize = W+TM+H; layer = <CALayer: 0x5bbf130>>
2011-12-13 17:56:34.217 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbf1b0; frame = (223 0; 76 216); opaque = NO; autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbf1e0>>
2011-12-13 17:56:34.218 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbf2f0; frame = (223 86; 76 62); opaque = NO; autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x5bbf320>>
2011-12-13 17:56:34.219 test[7615:207] sub an views <_UIOnePartImageView: 0x5bbf3c0; frame = (299 86; 1 48); opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x5bbf3f0>>
2011-12-13 17:56:34.220 test[7615:207] sub an views <_UIPickerViewTopFrame: 0x5bbb220; frame = (0 0; 320 216); opaque = NO; autoresize = W+H; layer = <CALayer: 0x5bbb460>>
我正在尝试从方向盘中删除日视图,我很好奇这种方法是否可以作为一种简单的方法来删除内容?此时的任何其他建议都会很好。
由于
答案 0 :(得分:2)
构建自己的UIPickerView
可能更容易,而不是尝试从UIDatePicker
实例中删除子视图。