gpt4 book ai didi

objective-c - Objective-C : Scrolling multiple XIB

转载 作者:行者123 更新时间:2023-11-28 17:39:29 24 4
gpt4 key购买 nike

我正在制作一个交互式杂志应用程序,我为每个页面制作了不同的 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com