gpt4 book ai didi

ios - 半透明 modalViewController

转载 作者:行者123 更新时间:2023-11-29 11:21:27 26 4
gpt4 key购买 nike

我一直在研究这个,似乎唯一的方法是使用 UIActionSheet,问题是我的 UIActionSheet 只覆盖了一半的屏幕,我的代码是:

MyViewController *myVC = [[myViewController alloc] init];
UIActionSheet *myActionSheet = [[UIActionSheet alloc] initWithTitle:@"\n\n"
delegate:self
cancelButtonTitle:@"cancel"
destructiveButtonTitle:@"done"
otherButtonTitles:nil];
[myActionSheet addSubview:myVC.view];
[myActionSheet showInView:currentView];
[myActionSheet release];

另外,我该如何从我的 MyViewController 中关闭这个 UIActionSheet?还有比这更好的解决方案吗?这是我所说的加载一半屏幕的截图:

screenshot

这是 a sample project来说明我的问题。

最佳答案

UIActionSheet 将根据其中的 UIButton 数量增加或减少它的高度。您可以做的是在您的 View 上方添加另一个具有所需 alpha 的 View 。并将其从 subview 中删除并根据您的要求添加 subview ,即在显示操作表时添加 subview ,在关闭 UIActionSheet 时删除。我希望这与您的问题相关,它将帮助您解决问题。

关于ios - 半透明 modalViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6965015/

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