私のアプリを作成するためにストーリーボードを使用したいと思います。 ナビゲーションやタブコントローラーと一緒に使う方法については、たくさんの情報がありますが、私はそれらのいずれかをやっていません。ナビゲーションコントローラのないセグレス
私の目標は、ナビゲーションやタブコントローラーを使用せずに、さまざまなビューを持つアプリケーションを作成することです。 どうすればよいですか?
私のアプリを作成するためにストーリーボードを使用したいと思います。 ナビゲーションやタブコントローラーと一緒に使う方法については、たくさんの情報がありますが、私はそれらのいずれかをやっていません。ナビゲーションコントローラのないセグレス
私の目標は、ナビゲーションやタブコントローラーを使用せずに、さまざまなビューを持つアプリケーションを作成することです。 どうすればよいですか?
なぜあなたはそれらを望んでいないのですか?あなた自身のために仕事をしているようです。
表示可能なUIを持たないナビゲーションコントローラを持つことができます。これは、他のUIViewControllerをプッシュしてポップするだけで、デフォルトのプッシュセグのタイプが機能します。
本当にの場合は、いつでもcustom segue classを作成し、それを使用してコントローラスタックを管理することができます。
IOSストーリーボードでは、ナビゲーションを使用したくない場合はプッシュセグを使用できません。その後、モーダルセグまたはカスタムセグを使用することができます。しかし
、これらの事前定義されたセグエアニメーションのすべてができない
- (void) perform
{
UIViewController *desViewController = (UIViewController *)self.destinationViewController;
UIView *srcView = [(UIViewController *)self.sourceViewController view];
UIView *desView = [desViewController view];
desView.transform = srcView.transform;
desView.bounds = srcView.bounds;
if(isLandscapeOrientation)
{
if(isDismiss)
{
desView.center = CGPointMake(srcView.center.x, srcView.center.y - srcView.frame.size.height);
}
else
{
desView.center = CGPointMake(srcView.center.x, srcView.center.y + srcView.frame.size.height);
}
}
else
{
if(isDismiss)
{
desView.center = CGPointMake(srcView.center.x - srcView.frame.size.width, srcView.center.y);
}
else
{
desView.center = CGPointMake(srcView.center.x + srcView.frame.size.width, srcView.center.y);
}
}
UIWindow *mainWindow = [[UIApplication sharedApplication].windows objectAtIndex:0];
[mainWindow addSubview:desView];
// slide newView over oldView, then remove oldView
[UIView animateWithDuration:0.3
animations:^{
desView.center = CGPointMake(srcView.center.x, srcView.center.y);
if(isLandscapeOrientation)
{
if(isDismiss)
{
srcView.center = CGPointMake(srcView.center.x, srcView.center.y + srcView.frame.size.height);
}
else
{
srcView.center = CGPointMake(srcView.center.x, srcView.center.y - srcView.frame.size.height);
}
}
else
{
if(isDismiss)
{
srcView.center = CGPointMake(srcView.center.x + srcView.frame.size.width, srcView.center.y);
}
else
{
srcView.center = CGPointMake(srcView.center.x - srcView.frame.size.width, srcView.center.y);
}
}
}
completion:^(BOOL finished){
//[desView removeFromSuperview];
[self.sourceViewController presentModalViewController:desViewController animated:NO];
}];
}
まだ問題が解決しない場合は、この投稿を確認してください。また、このカスタムセグエを実装する方法をお見せするためにユーチューブのビデオを持っている:
インターネットでもこの解決策が見つかりました:http://stackoverflow.com/questions/15139909/auto-layout-screen-rotation-and-uiview-animation/20958850#20958850 – asdfasdfads
あなたはストーリーボードでUIを隠すにはどうすればよいですか?そして、プログラマチックにViewControllerを押し込んでポップするにはどうしたらいいですか? – Crashalot