objective-c - Objective-C : Scrolling multiple XIB

标签 objective-c ios xcode ipad

我正在制作一个交互式杂志应用程序,我为每个页面制作了不同的 XIB。

我如何在滑动时切换页面(不同的 XIB)? 是否可以使用滚动的 XIB?

之前,我使用具有一个 XIB 的 UIScrollView 并且分页工作正常,但我在应用触摸事件和手势时遇到问题。

最佳答案

像 Dimme 一样,我建议您通过识别手势的方法以模态方式加载您的另一个 View ,例如:

- (void)doGestureAction:(UISwipeGestureRecognizer *)recognizer {

    /* load your another view here */

    yourAnotherViewController *controller = [[yourAnotherViewController alloc]initWithNibName:@"yourAnotherViewController" bundle:nil];

    controller.delegate = self;

    controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
   [self presentModalViewController:controller animated:YES];

    [controller release];
}

你可以改变过渡到另一个 View 的方式,它的动画设置变量 controller.modalTransitionStyle: 到这个可用的选项

UIModalTransitionStyleCrossDissolve
UIModalTransitionStyleCoverVertical
UIModalTransitionStyleFlipHorizontal
UIModalTransitionStylePartialCurl

关于objective-c - Objective-C : Scrolling multiple XIB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8721224/

相关文章:

objective-c - 如何将一个 NSImageView 置于另一个 NSImageView 的前面或后面?

objective-c - cocoa :使用dispatch_async错误

iOS - 复制 UITextView

ios - 在 swift 中引用父 View Controller

ios - Objective-C - 弱对象自动注册到 autoreleasepool 中?

xcode - 用下载的最新 1.8.3 替换 Xcode 的 git

objective-c - Mac OS X 用户界面 : How to create plus & minus buttons?

ios - swift:在导航栏中设置后退按钮图像

iphone - 带有 JSON 响应的 TextField 自动完成

ios - Xcode 4.3 在 Mac OS X 10.7.3 中安装错误?