如何停靠操作表

发布于 2024-10-11 01:14:33 字数 166 浏览 3 评论 0原文

我有一个 actionsheet ,其中包含一个 pickerView ,后面有一个表格视图 但是当我滚动表格视图时,孔选择器也会随之滚动。 我的问题是如何“停靠”我的 pickerview 并使其始终显示在屏幕底部。

多谢

I have an actionsheet which contains a pickerView and I have a table view behind
but when I scroll the table view the hole picker is scrolled with it.
My question is how to "dock" my pickerview and make it appear always at the bottom of the screen.

thanks a lot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生活了然无味 2024-10-18 01:14:33

听起来您没有正确放置操作表。您根本不希望它“从屏幕上”加载,而是仅在需要时才调用和关闭。一个简单的解决方案是在呈现 actionSheet 时暂停 UI。我使用 Github 上的一个名为 EAActionSheetPicker 的库来处理这个问题。它会简化您的代码,因为您所要做的就是调用:

NSArray *options = [NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", @"Five", nil];

EAActionSheetPicker *actionPicker = [[EAActionSheetPicker alloc]initWithOptions:options];
actionPicker.textField = self.emailField;
actionPicker.delegate = self;

[actionPicker showInView:self.view];

It sounds like you're not placing your actionSheet properly. You don't want it to be loaded 'off the screen' at all, but called and dismissed only when it's needed. A simple solution would be to pause the UI while the actionSheet is presented. I use a library on Github to handle this for me called EAActionSheetPicker. It would simplify your code 'cause all you'd have to do is call:

NSArray *options = [NSArray arrayWithObjects:@"One", @"Two", @"Three", @"Four", @"Five", nil];

EAActionSheetPicker *actionPicker = [[EAActionSheetPicker alloc]initWithOptions:options];
actionPicker.textField = self.emailField;
actionPicker.delegate = self;

[actionPicker showInView:self.view];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文