gpt4 book ai didi

ios - IIViewDeckController 左侧始终显示在 iPad 上

转载 作者:行者123 更新时间:2023-11-28 20:18:17 26 4
gpt4 key购买 nike

我正在使用 IIViewDeckController,我希望始终打开左侧 Controller 并调整中心 View 的大小,以便布局看起来类似于 UISplitViewController

根据文档:

It is possible to have the viewController always show a side controller. You do this by setting the maxSize value to any (positive) nonzero value. This will force the centerview to be always opened, exposing a side controller permanently. This only works when you have ONE sidecontroller specified (this means either a left side controller or a right side controller), because this scenario does not make sense if you would be able to slide the center view in both directions. When you have 2 side controllers, this property is ignored.

我完全按照它说的做了,但它不会总是显示侧 Controller :

PUCNews *news = [[PUCNews alloc] init];
UINavigationController *newsNav = [[UINavigationController alloc] initWithRootViewController:news];
[puc.cachedViewControllers setObject:newsNav forKey:@"news"];
PUCLeftNavigationViewController *leftNav = [[PUCLeftNavigationViewController alloc] init];
IIViewDeckController *deckController = [[IIViewDeckController alloc] initWithCenterViewController:newsNav leftViewController:leftNav];
deckController.openSlideAnimationDuration = 0.20f;
deckController.closeSlideAnimationDuration = 0.20;
deckController.centerhiddenInteractivity = IIViewDeckCenterHiddenNotUserInteractiveWithTapToClose;
deckController.elastic = NO;
if ([Utility isIpad]) {
//deckController.leftSize = 200;
deckController.maxSize = 500;
//deckController.sizeMode = IIViewDeckLedgeSizeMode;
[deckController toggleLeftViewAnimated:NO];
deckController.centerhiddenInteractivity = IIViewDeckCenterHiddenUserInteractive;
deckController.resizesCenterView = YES;
deckController.panningMode = IIViewDeckNoPanning;
}

这也导致了一些非常奇怪的旋转问题。

如何始终打开左侧 Controller 并调整中心 View 的大小,使其适合屏幕的其余部分?

最佳答案

我用过,

self.leftController = leftController;
self.leftSize = 700;
[self openLeftViewAnimated:NO];

这对我有用,因为我想要左侧尺寸的小空间。之后您可能需要调整大小,但这有效!

希望对你有帮助。

干杯

关于ios - IIViewDeckController 左侧始终显示在 iPad 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16950719/

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