gpt4 book ai didi

iphone - UITabBarController提供的模态viewController

转载 作者:行者123 更新时间:2023-12-01 18:30:24 27 4
gpt4 key购买 nike

我有一个类是UITabBarController的子类,其中包含4个子viewControllers。我添加了类似于RedLaser,Instagram,Path,DailyBooth和其他应用程序的按钮。我的就像这里的最高示例:



此按钮调用TabBarController中的一个方法,该方法提供一个模式viewController。当关闭它时,当前选定的viewController中的NavigationControllers开始表现异常。直到您在tabBar上选择另一个选项卡,流行动画都被弄乱了,并且发生了其他小错误。然后动画就很好了,直到再次显示viewController为止。

我确定这是因为我不正确地将其关闭,但是我不确定该如何完成。

这是我在TabBarController中的代码:

-(void)showScanner {
ZBarReaderViewController *reader = [[ZBarReaderViewController alloc] init];
reader.readerDelegate = self;
reader.supportedOrientationsMask = ZBarOrientationMaskAll;

ZBarImageScanner *scanner = reader.scanner;
[scanner setSymbology:ZBAR_I25
config:ZBAR_CFG_ENABLE
to:0];
[scanner setSymbology:ZBAR_QRCODE
config:ZBAR_CFG_ENABLE
to:0];

[reader setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentModalViewController:reader
animated:YES];
[reader release];
//[self playBeep];
}

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
id<NSFastEnumeration> results = [info objectForKey:ZBarReaderControllerResults];
ZBarSymbol *symbol = nil;
for (symbol in results)
break;
NSString *barcode = symbol.data;

UINavigationController *searchNavController = [[self viewControllers] objectAtIndex:1];
WLSearchViewController *searchVC = [searchNavController.viewControllers objectAtIndex:0];

// WLSearchViewController *searchVC = [[self viewControllers] objectAtIndex:1];
//[searchNavController popToRootViewControllerAnimated:NO];
[self setSelectedViewController:searchNavController];
[self dismissModalViewControllerAnimated:YES];

[self playBeep];

[searchVC handleSearchForTerm:barcode];
}

-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[self dismissModalViewControllerAnimated:YES];
}

最佳答案

找到了问题所在,想想我将其发布以帮助遇到此问题的任何人。

我在我的tabBarController中重写了viewDidAppear:animated:但我没有调用[super viewDidAppear:animated:]
补充说,一切都更好!

关于iphone - UITabBarController提供的模态viewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9612254/

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