UIPopoverController too large and UIPickerView too small

谁都会走 提交于 2019-12-01 20:30:15

The reason for the "squashed" picker view seems to be this line:

[pickerController setView:self.picker];

Instead, add the picker view as a subview:

[pickerController.view addSubview:picker];


Next, to fix the popover height, set popoverContentSize before presenting it:

pickerPopover.popoverContentSize = picker.frame.size;


Also, fix the picker view's frame from this:

CGRectMake(0, self.view.bounds.size.height+44, 320, 216)

to this:

CGRectMake(0, 0, 320, 216)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!