更新时间:2023-12-04 12:22:28
我想你正在处理iPhone SDK?可能有一些其他框架使用此名称,因此您可以添加标签以包含uikit,cocoa-touch等。
I suppose you're dealing with the iPhone SDK? There may be some other frameworks which uses this name, so maybe you can add your tags to include uikit, cocoa-touch or something.
无论如何,您可以设置 showsSelectionIndicator 为NO,因此它隐藏了选择器。然后,您可以使用调整后的选择样式创建一个新视图,并将其添加到UIPickerView上方的超级视图。
Anyway, you can set showsSelectionIndicator
of the UIPickerView instance to NO, so it hides the selector. Then you can create a new view with the adjusted selection style, and add it to the superview above the UIPickerView.
// Some sample code, but you can do this in IB if you want to
_pickerView = [[UIPickerView alloc] init];
_pickerView.showsSelectionIndicator = NO;
[_pickerView sizeToFit];
[self.view addSubview:_pickerView];
UIImage *selectorImage = [UIImage imageNamed:@"selectorImage.png"]; // You have to make it strechable, probably
UIView *customSelector = [[UIImageView alloc] initWithImage:selectorImage];
customSelector.frame = CGRectZero; // Whatever rect to match the UIImagePicker
[self.view addSubview:customSelector];
[customSelector release];
攻击UI元素本身需要做更多的工作,而且这也必须正常工作。
Hacking the UI Element itself will take much more work, and this has to work as well.