我剛剛工作的這一個,但希望做盡可能多的故事板儘可能從而改變了做法有點:
1)選擇在故事板和取消選中路線了酥料餅/向下/向左/向右擺脫箭頭。
爲中心,它在屏幕上覆蓋了賽格瑞準備,做這樣的事情:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
UIStoryboardPopoverSegue* popover = (UIStoryboardPopoverSegue*)segue;
CGFloat horizontalInset = (self.view.frame.size.width - popover.popoverController.popoverContentSize.width)/(CGFloat)2.0;
CGFloat verticalInset = (self.view.frame.size.height - popover.popoverController.popoverContentSize.height)/(CGFloat)2.0;
popover.popoverController.popoverLayoutMargins =
UIEdgeInsetsMake(
verticalInset,
horizontalInset,
verticalInset,
horizontalInset);
}
在我來說,我還發現,讓我改變背景顏色的酥料餅SEGUE圓角半徑不符合我的設計清除整理了這一點,即它添加到上面的塊:
popover.popoverController.backgroundColor = [UIColor clearColor];
2)在對SEGUE目標控制器查找屬性「酥料餅」,並勾選「使用明確的大小」,並把大小你想它出現在popover模式。
適用於iOS 5.x – 2012-03-22 10:29:54
對於橫向模式下的iPad,我必須切換CGRectMake寬度和高度才能正確地居中對齊。 – Alan 2012-04-03 18:20:37
也適用於iOS 7.0.x。 – 2014-02-03 14:47:26