[英]Is it possible to build an iOS mobile application for the App Store to export iMessages to PDF?
[英]iOS - presentViewController like the image (Open iMessages app store in Messages)
我想像上面的圖像一樣呈現一個UINavigationController
,我使用
nvc.modalPresentationStyle = UIModalPresentationFormSheet;
但是我無法更改控制器的大小。
這是我做的:
UIViewController *vc = [[UIViewController alloc] init];
vc.view.backgroundColor = [UIColor grayColor];
UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
nvc.modalPresentationStyle = UIModalPresentationFormSheet;
nvc.view.frame = CGRectInset(self.view.bounds, 20, 20);
[self presentViewController:nvc animated:YES completion:nil];
但是當前的viewController仍然是全屏。
可能是您可以按如下方式使用preferredContentSize
:
nvc.modalPresentationStyle = UIModalPresentationFormSheet;
nvc.preferredContentSize = CGSizeMake(width, height);
喜歡,
nvc.preferredContentSize = CGSizeMake(300, 600);
要么
在Presented viewController的viewDidLoad
方法中,編寫以下代碼:
self.preferredContentSize = CGSizeMake(width, height);
編輯:
選擇您的viewController或xib並將size
屬性設置為Freeform
。
在屬性檢查器的“內容大小”中啟用用戶首選的顯式大小。
有關更多詳細信息,請參見此處的答案:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.