UIAlert 视图中的非活动按钮

发布于 2024-09-16 09:46:22 字数 215 浏览 2 评论 0原文

在我的 iPhone 应用程序中,我的导航栏中有一个“共享”按钮,会弹出一个带有“Twitter”和“Facebook”选项的 UIAlertView。当用户已经向 Twitter 发送了一些内容时,我不希望他能够再次发送该内容。

防止这种情况的一种方法是从该警报中删除 Twitter 按钮。这使得警报有点不一致/不可预测,我宁愿将 Twitter 按钮“灰显”。

有更好的方法吗?

In my iphone-app, I have a "Share" button in my Navigation bar, that pops up a UIAlertView with the options "Twitter" and "Facebook". When a user has already sent something to Twitter, I don't want him to be able to sent it again.

One way of preventing this, is to just remove the Twitter button from that Alert. This makes the Alert kind of inconsistent/unpredictable, and I would rather 'grey out' the Twitter button.

Is there a better way of doing this?

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

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

发布评论

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

评论(1

奢欲 2024-09-23 09:46:22

根据您正在做的事情,您应该使用 UIActionSheet。它遵循 HIG,然后您可以更好地控制 UX。

当您点击共享时,只需使用您希望用户选择的任何选项创建操作表即可。

Based on what you are doing, you should use an UIActionSheet. It follows the HIG and then you can control the UX a bit better.

When you tap share, just create the action sheet with whatever options you want to allow the user to select.

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