需要在ViewController中显示4个UIPickerView。UIPickerView高度自定义
我如何定制身高?
我们可以给出的最小高度是162. 我可以给每个UIPickerView 100高度吗? 有没有可用的框架或示例?
需要在ViewController中显示4个UIPickerView。UIPickerView高度自定义
我如何定制身高?
我们可以给出的最小高度是162. 我可以给每个UIPickerView 100高度吗? 有没有可用的框架或示例?
尝试用下面的代码,它可能会在你的工作情况:
self.MyPickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 0, 320, 100)];
对于其他提示检查这个答案
试试这个:
UIPickerView *picker = [[UIPickerView alloc] initWithFrame: CGRectZero];
picker.showsSelectionIndicator = YES;
picker.autoresizingMask = UIViewAutoresizingFlexibleWidth;
CGSize ps = [picker sizeThatFits: CGSizeZero];
picker.frame = CGRectMake(0.0, 0.0, ps.width, ps.height + 100);
对于UIPickerView
只有三个身高:162,180,216。您可以使用CGAffineTransformMakeTranslation
和CGAffineTransformMakeScale
正确适合选取器。
CGAffineTransform t;
CGAffineTransform s;
CGAffineTransform u;
UIPickerView *pickerview;
t = CGAffineTransformMakeTranslation (0, pickerview.bounds.size.height);
s = CGAffineTransformMakeScale (1.0,0.5);
u = CGAffineTransformMakeTranslation (0 ,pickerview.bounds.size.height);
pickerview.transform = CGAffineTransformConcat (t, CGAffineTransformConcat(s,u));
这里上面的代码改变了选择器视图的高度。
是的..但是选择器视图中的文本不清楚 –
如果您不介意剪切两端,可以将其嵌入较小的视图中,并启用剪切。
使用UIPopoverController的contentSize属性来设置弹出窗口的大小。 你是否需要同时显示所有四个弹出? –
对不起..我编辑了我的问题.. –