この問題については、stackoverflowにいくつかのスレッドを読んだことがありますが、私の最も基本的で直接的なケースではうまくいきませんでした。dismissViewControllerAnimatedは黒い画面を残す
私は(コードを以下に示す)のクラスを持ってXCodeの7.2.1とiOS 9.2
を使用していUINavigationController
のプレゼンターとして使用するUIViewController
を受け入れること。
このコードは、ONEクラスのものであり、プレゼンテーションとディスマイズの両方を行います。下図のスクリーン1を皮切り
、ユーザーがUINavigationController
(画面2の右上の「完了」ボタンをタップし、最後に画面2にUINavigationController
を提示し、左上隅、内のボタンをタップします)は黒いスクリーン...スクリーン3を引き起こします。
最後に、黒い画面に数字の入った赤い丸が表示されます。 これは画面1のタブバーからのものです。なんらかの理由で、それは角のすべてのタブバーのボタンを積み重ねて、それらが見えるように少しの領域を残しました。
-(id)initWithDashboardParentViewController:(TabMapController*)mapVC propertyDelegate:(id<iRpPropertyDelegate>)propertyDelegate
{
self = [super init];
if (self)
{
mapViewController = mapVC;
thePropertyDelegate = propertyDelegate;
}
return self;
}
-(void)displaySpreadsheetOfAllSubitems
{
UIViewController *theContentController;
// Create a generic gridview view controller and initialize it with the data that will be shown.
theContentController = [[iRpGenericGridViewController alloc] initWithPropertyDelegate:propertyDelegate dashboardDataItem:spreadsheetTableData];
theContentController.edgesForExtendedLayout = UIRectEdgeNone;
// Create a navigation controller and embed the content view controller.
UINavigationController *theNavController = [[UINavigationController alloc] initWithRootViewController:theContentController];
// If a detail item was found for this section, then display it in the navigation controller.
if (theNavController)
{
// Set up the 'Done' navigation bar button.
theNavController.topViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(detailDisclosureDone)];
[mapViewController presentViewController:theNavController animated:YES completion:^(void){}];
}
}
-(void)detailDisclosureDone
{
[mapViewController dismissViewControllerAnimated:NO completion:^{}];
}