gpt4 book ai didi

iphone - UITabBarController,有什么可能的方法可以通过水平滑动移动下一个 View Controller?

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

我是 iOS 新手。不确定是否有可能带来以下逻辑。

1. UITabBarController has three UIViewController.
2. While Swipping horizontally in the second UIViewController, i want to move
to the third UIViewController.

这可能吗?如果是这样,请建议如何实现相同的目标。

最佳答案

在第二个 ViewController 的 ViewDidLoad 中添加以下行

UISwipeGestureRecognizer *swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(gotoNextPage:)];
[self.view addGestureRecognizer:swipeRecognizer];
[swipeRecognizer release];

并添加方法

-(void)gotoNextPage:(id)sender {
[self.tabBarController setSelectedViewController:thirdViewController];
}

关于iphone - UITabBarController,有什么可能的方法可以通过水平滑动移动下一个 View Controller?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13700669/

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