Displaying a message in iOS which has the same functionality as Toast in Android

前端 未结 19 1699
逝去的感伤
逝去的感伤 2020-12-12 12:35

I need to know if there is any method in iOS which behaves like Toast messages in Android. That is, I need to display a message which is dismissed automatically after few se

相关标签:
19条回答
  • 2020-12-12 13:38

    In Android, a Toast is a short message that displays on the screen for a short amount of time and then disappears automatically without disrupting user interaction with the app.

    So a lot of people coming from an Android background want to know what the iOS version of a Toast is. Besides the current question, other similar questions can be found here, here, and here. The answer is that there is no exact equivalent to a Toast in iOS. Various workarounds that have been presented, though, including

    • making your own Toast with a UIView (see here, here, here, and here)
    • importing a third party project that mimics a Toast (see here, here, here, and here)
    • using a buttonless Alert with a timer (see here)

    However, my advice is to stick with the standard UI options that already come with iOS. Don't try to make your app look and behave exactly the same as the Android version. Think about how to repackage it so that it looks and feels like an iOS app. See the following link for some choices.

    • Overview of the standard iOS options for temporarily displaying information to a user.

    Consider redesigning the UI in a way that conveys the same information. Or, if the information is very important, then an Alert might be the answer.

    0 讨论(0)
提交回复
热议问题