Android: iOS UIActionSheet equivalent
Asked Answered
C

2

8

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.

Cimino answered 30/5, 2012 at 0:40 Comment(0)
S
9

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.

Scarecrow answered 30/5, 2012 at 0:43 Comment(0)
L
4

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#

Lutanist answered 8/12, 2016 at 6:53 Comment(1)
I would recommend to use BottomSheet too. It's 2018 indeed :)Eichman

© 2022 - 2024 — McMap. All rights reserved.