Android: iOS UIActionSheet equivalent

限于喜欢 提交于 2019-12-09 16:43:14

问题


I am converting an iOS app over and need to implement the equivalent of a UIActionSheet from iOS to Android.

What UI element would most closely mimic this.

I am targeting Android 2.2 and up.


回答1:


You would use an AlertDialog or Dialog object. The AlertDialog class does what you ask. Dialog allows for more customizability.

Edit: if you want the same animative effect, you're going to need to use a SlidingDrawer.

Note: None of these classes, except maybe the AlertDialog, are as easy to use as the UIActionSheet.




回答2:


Bottom Sheet is a material design component, that was added to design support library in version 23.2. Bottom sheet is a very simple window that displays from the bottom of the screen and its provide similar view like IOS UIActionSheet and developer can customize as per requirement.

add dependency compile 'com.android.support:design:<latest-library-version>' in app gradle.

Refer this link-- https://material.google.com/components/bottom-sheets.html#



来源:https://stackoverflow.com/questions/10808608/android-ios-uiactionsheet-equivalent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!