# Actionsheet's Android "ugly" styling.. need help

**URL:** <https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462>\
**Category:** ionic-v1\
**Created:** [March 2, 2015, 1:02pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462 "2015-03-02T13:02:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![madgrizzle](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@madgrizzle](https://forum.ionicframework.com/u/madgrizzle)\
**Post date:** [March 2, 2015, 1:02pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/1 "2015-03-02T13:02:51Z")

</div>

In the nightly, the actionsheet CSS has a platform specific update for android. It removes the cancel button (I’m ok with that) but also renders everything else pretty ugly (not so okay with that). Here’s an example of what it looks like.

 ![image](https://global.discourse-cdn.com/ionicframework/original/2X/f/fd4c813d10d06b789643952298071df52b07963a.png)

The code I’m using is (abbreviated)

```
   $scope.addSomething = function(){
       $ionicActionSheet.show({
           buttons: [
               {text: 'Create Stack of Cards'},
               {text: 'Add New Card'},
           ],
           titleText: 'Add',
           cancelText: 'Cancel',
           cancel: function() {
               return false;
           },
           buttonClicked: function(index){
               if (index==0) {
                   console.log("index="+index);
                   return true;
               }
               if (index==1) {
                   console.log("index="+index);
                   return true;
               }
           }
       })
   }

```

Any examples on how to make it not look so ugly yet still look android-ish?

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [March 2, 2015, 10:55pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/2 "2015-03-02T22:55:39Z")

</div>

Just to remind you, we’re incorporating material design aspects into ionic, so thats why there are style changes.

> **[ActionSheet: Nightly](https://codepen.io/mhartington/pen/KwBpRq)**
>
> Demo of an Ionic actionsheet Forked from \[Ionic\](http://codepen.io/ionic/)'s Pen \[Modal: Nightly\](http://codepen.io/ionic/pen/gblny/)....

[http://www.google.com/design/spec/components/bottom-sheets.html#bottom-sheets-usage](http://www.google.com/design/spec/components/bottom-sheets.html#bottom-sheets-usage)

To change, this, just use css

---

<div class="post-metadata">

**Author:** ![madgrizzle](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@madgrizzle](https://forum.ionicframework.com/u/madgrizzle)\
**Post date:** [March 4, 2015, 12:26pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/3 "2015-03-04T12:26:42Z")

</div>

Got it… I hadn’t realized that was what was going on and assumed I was doing something wrong.

---

<div class="post-metadata">

**Author:** ![lwf](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lwf/32/83367_2.png) [@lwf](https://forum.ionicframework.com/u/lwf)\
**Post date:** [April 7, 2015, 6:46am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/4 "2015-04-07T06:46:50Z")

</div>

If you want to the looks to be same in android and iphone then find the below code block in css stylesheet and comment it out. Then it will look the same as in iphone.

.platform-android .action-sheet-backdrop.active {  
background-color: rgba(0, 0, 0, 0.2); }  
.platform-android .action-sheet {  
margin: 0; }  
.platform-android .action-sheet .action-sheet-title, .platform-android .action-sheet .button {  
text-align: left;  
border-color: transparent;  
font-size: 16px;  
color: inherit; }  
.platform-android .action-sheet .action-sheet-title {  
font-size: 14px;  
padding: 16px;  
color: #666; }  
.platform-android .action-sheet .button.active, .platform-android .action-sheet .button.activated {  
background: #e8e8e8; }  
.platform-android .action-sheet-group {  
margin: 0;  
border-radius: 0;  
background-color: #fafafa; }  
.platform-android .action-sheet-cancel {  
display: none; }  
.platform-android .action-sheet-has-icons .button {  
padding-left: 56px; }

i copy this from @aaditya

---

<div class="post-metadata">

**Author:** ![AshConnell](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ashconnell/32/64477_2.png) [@AshConnell](https://forum.ionicframework.com/u/AshConnell)\
**Post date:** [April 17, 2015, 5:05am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/5 "2015-04-17T05:05:55Z")

</div>

@mhartington I just incorporated the full material spec for bottom-sheets into our ionic app. One thing you are currently missing is the ability to handle lists that are larger than the screen. In my implementation:

- the first X items are displayed (similar to what you have)
- the X+1 item is half visible at the bottom (UX to imply there are more)
- you can drag the menu upwards and it snaps to the top of the screen
- If all of the items aren’t visible, then the list is scrollable

Here’s a video of it in action: [https://vid.me/1RPT](https://vid.me/1RPT)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [April 17, 2015, 12:17pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/6 "2015-04-17T12:17:20Z")

</div>

Oh nice that looks awesome. Any chance you could share some code?  
We’re not planning on adding anything else to ionic until we get to 1.0 final, but this would be something that would investigate.

---

<div class="post-metadata">

**Author:** ![AshConnell](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ashconnell/32/64477_2.png) [@AshConnell](https://forum.ionicframework.com/u/AshConnell)\
**Post date:** [April 19, 2015, 6:40am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/7 "2015-04-19T06:40:20Z")

</div>

I kind of hacked this together to work in a codepen. Its very specific to our app and not a turn key solution for everyone to use - but it might be helpful to someone building their own:

> **[BottomSheet: Nightly](https://codepen.io/Deminetix/pen/dobZoa)**
>
> Demo of an Ionic actionsheet Forked from \[Ionic\](http://codepen.io/ionic/)'s Pen \[Modal: Nightly\](http://codepen.io/ionic/pen/gblny/). Forked from \[I...

I had to make a bunch of hacky changes to prevent me needing to pull in a bunch of other dependencies.

---

<div class="post-metadata">

**Author:** ![fertw](https://avatars.discourse-cdn.com/v4/letter/f/5e9695/32.png) [@fertw](https://forum.ionicframework.com/u/fertw)\
**Post date:** [April 22, 2015, 10:09pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/8 "2015-04-22T22:09:33Z")

</div>

actionSheets crash at last lib updates

---

<div class="post-metadata">

**Author:** ![owndmorix](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@owndmorix](https://forum.ionicframework.com/u/owndmorix)\
**Post date:** [September 28, 2015, 10:31pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/9 "2015-09-28T22:31:09Z")

</div>

@mhartington Why doesn’t cancel button appears on android? On ios, it appears

---

<div class="post-metadata">

**Author:** ![ninoguba](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@ninoguba](https://forum.ionicframework.com/u/ninoguba)\
**Post date:** [October 23, 2015, 6:58pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/10 "2015-10-23T18:58:48Z")

</div>

> [@mhartington](#):
>
> [Material Design](http://www.google.com/design/spec/components/bottom-sheets.html#bottom-sheets-usage)

If I may, this is due to Material’s design guidelines on bottom sheets quoted as follows:

> Bottom sheets can be dismissed by swiping the bottom sheet down, by touching an explicit control such as an X in the app bar, or by touching the system back button (Android). Modal bottom sheets can also be dismissed by touching outside of the bottom sheet.

Also, I would like to add to the solution the following snippet of code for adding an icon only for Android:

```
            // Show the action sheet
            var hideSheet = $ionicActionSheet.show({
                destructiveText: (ionic.Platform.isAndroid()?'<i class="icon ion-android-exit assertive"></i> ':'')+'End Task',
                cancelText: 'Cancel',
                cancel: function() {
                    hideSheet();
                },
                destructiveButtonClicked: function(index) {
                    console.log('Clicked end task');
                    //your function
                    return true;
                }
            });

```

---

<div class="post-metadata">

**Author:** ![goutamsinghacse](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/goutamsinghacse/32/94129_2.png) [@goutamsinghacse](https://forum.ionicframework.com/u/goutamsinghacse)\
**Post date:** [November 24, 2015, 11:55am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/11 "2015-11-24T11:55:01Z")

</div>

Hey, This is very simple. in \_action-sheet.scss, just change the

.platform-android to .xplatform-android

Now, see same style of action sheet in both ios and android 😄

---

<div class="post-metadata">

**Author:** ![cherry\_wave](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/cherry_wave/32/106859_2.png) [@cherry\_wave](https://forum.ionicframework.com/u/cherry_wave)\
**Post date:** [January 11, 2016, 9:58am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/12 "2016-01-11T09:58:28Z")

</div>

I copied the css also from this old forum post here. Then changed it as you said. So now it looks like:

```
.xplatform-android .action-sheet-backdrop.active {
background-color: rgba(0, 0, 0, 0.2); }
.xplatform-android .action-sheet {
margin: 0; }
.xplatform-android .action-sheet .action-sheet-title, .platform-android .action-sheet .button {
text-align: left;
border-color: transparent;
font-size: 16px;
color: inherit; }
.xplatform-android .action-sheet .action-sheet-title {
font-size: 14px;
padding: 16px;
color: #666; }
.xplatform-android .action-sheet .button.active, .platform-android .action-sheet .button.activated {
background: #e8e8e8; }
.xplatform-android .action-sheet-group {
margin: 0;
border-radius: 0;
background-color: #fafafa; }
.xplatform-android .action-sheet-cancel {
display: none; }
.xplatform-android .action-sheet-has-icons .button {
padding-left: 56px; }

```

but it still looks the same on android: Textcolor is black and only when I click the destructive option, it changes to red for a short time (and it still doesn’t look so fancy as in ios)

---

<div class="post-metadata">

**Author:** ![sakotturi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sakotturi](https://forum.ionicframework.com/u/sakotturi)\
**Post date:** [January 30, 2016, 8:18pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/13 "2016-01-30T20:18:37Z")

</div>

@cherry_wave,

I tweaked a couple things including some margins and text color to get it more like ios while trying to keep some material-design properties. In other words, just trying to make use-able and not some text bunched down in the corner of the screen:

```auto
.platform-android .action-sheet-backdrop.active {
background-color: rgba(0, 0, 0, 0.1); }
    .platform-android .action-sheet {
align-content: center;
margin:auto;
max-width: 96vw;
border-radius: 5px;
/*margin: 0;*/
margin-bottom: 10px;}
    .platform-android .action-sheet .action-sheet-title, .platform-android .action-sheet .button {
text-align: left;
/*border-color: #e2e2e2;*/
font-size: 16px;
color: inherit;}
    .platform-android .action-sheet .action-sheet-title {
font-size: 14px;
padding: 16px;
color: #666; }
    .platform-android .action-sheet .button {
border-color: #e2e2e2;
padding-left: 16px;
color: #104e89;
    }
    .platform-android .action-sheet .button.destructive {
color: red;
    }
    .platform-android .action-sheet .button.active, .platform-android .action-sheet .button.activated {
background: #e8e8e8; }
    .platform-android .action-sheet-group {
/*margin: 0;*/
border-radius: 0;
background-color: #fafafa; }
    .platform-android .action-sheet-cancel {
display: none;
    }
    .platform-android .action-sheet-has-icons .button {
padding-left: 56px; }

```

hope that helps a bit

---

<div class="post-metadata">

**Author:** ![s00pa](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/s00pa/32/95064_2.png) [@s00pa](https://forum.ionicframework.com/u/s00pa)\
**Post date:** [February 18, 2016, 1:51am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/14 "2016-02-18T01:51:21Z")

</div>

very nice styling, thanks for that! 🙂

---

<div class="post-metadata">

**Author:** ![PritisD](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@PritisD](https://forum.ionicframework.com/u/PritisD)\
**Post date:** [July 25, 2016, 10:43am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/15 "2016-07-25T10:43:29Z")

</div>

still cancel button not displaying on android

---

<div class="post-metadata">

**Author:** ![sakotturi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sakotturi](https://forum.ionicframework.com/u/sakotturi)\
**Post date:** [July 25, 2016, 5:29pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/16 "2016-07-25T17:29:42Z")

</div>

Is it being hidden or is it just located outside of the view?

---

<div class="post-metadata">

**Author:** ![RakeshYadvanshi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rakeshyadvanshi/32/102086_2.png) [@RakeshYadvanshi](https://forum.ionicframework.com/u/RakeshYadvanshi)\
**Post date:** [August 6, 2016, 3:59am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/17 "2016-08-06T03:59:23Z")

</div>

this solve my problem,… thanks @lwf and @aaditya

---

<div class="post-metadata">

**Author:** ![Thesurya9](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/thesurya9/32/117460_2.png) [@Thesurya9](https://forum.ionicframework.com/u/Thesurya9)\
**Post date:** [September 10, 2016, 9:41am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/18 "2016-09-10T09:41:37Z")

</div>

Awesome !! Really helpful . (y)

---

<div class="post-metadata">

**Author:** ![Love9056](https://avatars.discourse-cdn.com/v4/letter/l/7c8e57/32.png) [@Love9056](https://forum.ionicframework.com/u/Love9056)\
**Post date:** [November 18, 2016, 8:58am UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/19 "2016-11-18T08:58:42Z")

</div>

cancel button is not visible how can i get it

---

<div class="post-metadata">

**Author:** ![ahmedemad3](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@ahmedemad3](https://forum.ionicframework.com/u/ahmedemad3)\
**Post date:** [June 29, 2017, 12:23pm UTC](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462/20 "2017-06-29T12:23:35Z")

</div>

> [@sakotturi](#):
>
> .platform-android .action-sheet-backdrop.active {  
> background-color: rgba(0, 0, 0, 0.1); }  
> .platform-android .action-sheet {  
> align-content: center;  
> margin:auto;  
> max-width: 96vw;  
> border-radius: 5px;  
> /_margin: 0;_/  
> margin-bottom: 10px;}  
> .platform-android .action-sheet .action-sheet-title, .platform-android .action-sheet .button {  
> text-align: left;  
> /_border-color: #e2e2e2;_/  
> font-size: 16px;  
> color: inherit;}  
> .platform-android .action-sheet .action-sheet-title {  
> font-size: 14px;  
> padding: 16px;  
> color: #666; }  
> .platform-android .action-sheet .button {  
> border-color: #e2e2e2;  
> padding-left: 16px;  
> color: #104e89;  
> }  
> .platform-android .action-sheet .button.destructive {  
> color: red;  
> }

add this css  
.platform-android .action-sheet-cancel {  
display: block !important;  
}

[Next page](https://forum.ionicframework.com/t/actionsheets-android-ugly-styling-need-help/18462.md?page=2)
