2016-06-07 5 views
3

UIDocumentMenuViewController을 표시하면 파일을 응용 프로그램에로드 할 수 있습니다. iPhone에서는 작동하지만 iPad에서는 작동하지 않습니다. iOS9 사용. 어떤 생각이 잘못 됐습니까? 45 : iPad에서는 UIDocumentMenuViewController가 작동하지 않지만 iPhone에서는 작동하지 않습니다.

2016년 6월 7일 09

dmvc = UIDocumentMenuViewController(documentTypes: ["public.data"], inMode: .Import) 
dmvc!.delegate = self 
dmvc!.popoverPresentationController?.sourceView = addSongButton 
self.presentViewController(dmvc!, animated: true, completion: nil) 
암기 45.256 [2994 : 977408]를 UICollectionViewFlowLayout의 행동이 정의되어 있지 않으므로 : 2016년 6월 7일 09 : 45 : 45.260 암기 [2,994 : 977408] 항목 너비는 보다 작아야하며 UICollectionView의 너비에서 왼쪽 섹션 인세 트를 뺀 값과 오른쪽 값에서 콘텐츠 삽입물 왼쪽 및 오른쪽 값을 뺀 값이어야합니다. 2016년 6월 7일 09 : 45 : 45.261 암기 [2994 : 977408] 관련 UICollectionViewFlowLayout 인스턴스 < _UIAlertControllerCollectionViewFlowLayout이다 0x1668e6e0> 및이를 에 부착되고; 애니메이션 = {bounds.origin =; bounds.size =; 위치 =; }; layer =; contentOffset : {0, 0}; contentSize : {0, 0}> 컬렉션 보기 레이아웃 : < _UIAlertControllerCollectionViewFlowLayout : 0x1668e6e0>. 2016-06-07 09 : 45 : 45.262 암기 [2994 : 977408] 디버거에서 을 catch하려면 UICollectionViewFlowLayoutBreakForInvalidSizes에서 기호 중단 점을 만듭니다.

왜 오류 메시지가 나타나는 이유는 무엇입니까? collectionView? 나는 collectionView를 전혀 사용하지 않는다. 어쩌면 UIDocumentMenuViewController 내부 부품으로 가지고 있나?

+0

를/ – MScottWaller

+0

사용해보기 : http://stackoverflow.com/a/25644145/3718570 – Ptah

답변

0

나는 동일한 문제가있었습니다. sourceView = self.view를 설정하고 sourceRect = theButton.frame을 만들어야했습니다.

3

아이 패드는 ActionSheets에 대한 특별한 규칙을 가지고 있으며, 자신의 취소 버튼, 그것은 일반적으로 당신의 ActionSheets를 표시하는 위치에 따라 달라집니다, 그래서 이것은 당신이 충돌 문제를 해결할 수있는 방법입니다 : 모든 행운 여기

 let importMenu = UIDocumentMenuViewController(documentTypes: [kUTTypeHTML as String ], in: .import) 
    importMenu.delegate = self 
    importMenu.modalPresentationStyle = .popover 
    importMenu.popoverPresentationController?.sourceView = self.view 
    self.present(importMenu, animated: true, completion: nil) 
관련 문제