iPhone Disabling UIActionSheet buttons

后端 未结 7 873
梦谈多话
梦谈多话 2020-12-10 16:01

I want to disable buttons in the UIAction sheet and enable them after a certain condition is true. How do I achieve this? Any ideas?

相关标签:
7条回答
  • 2020-12-10 16:19

    I faced a similar problem when I had an action sheet that changes based on some conditions. I omitted the choices that are not applicable from the action sheet altogether but in some cases I end up with an action sheet with just one choice. This seems a bit silly, since I could activate that choice immediate without displaying the sheet at all.

    However, I also want users to learn that clicking a certain button on screen gives them a list of choices they can choose from. That's why I want to display the action sheet also in cases when it has just one choice. I thought about disabling the non-applicable choices instead of omitting them from the sheet but that didn't feel right, either.

    My case is related to having a user-icon in a custom bottom bar and pressing it presents the following choices:

    • if logged in
      • My Profile
      • Log out
    • if not logged in
      • Log in
    0 讨论(0)
提交回复
热议问题