我只在极少数 iPhone 应用程序中看到过它......但它看起来像一个左/右旋转的选择器(而不是顶部/底部)。
他们通常将其放在 tableView 的 1 行...以允许用户在少量选项(如 3-10)之间快速进行选择。
这是如何编码的?
继续戴夫·德隆的回答,我让它像这样工作......
In viewDidLoad
我做了这个...
CGRect frame = horizontalPickerView.frame;
frame.size.width = 50;
frame.size.height = 216;
frame.origin.x=90;
frame.origin.y = 200;
horizontalPickerView.frame = frame;
horizontalPickerView.transform = CGAffineTransformMakeRotation(3.14159/2);
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
UILabel *lbl = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 30, 20)] autorelease];
lbl.transform = CGAffineTransformMakeRotation(-3.14159/2);
lbl.text = @"hi";
return lbl;
}
希望这可以帮助
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)