9

I'm trying to theme an activity as an AlertDialog. The problem I'm facing is that I can't find a way to put two buttons on the bottom of my window that would look like the positive and negative buttons of an AlertDialog

I've already added that line to my Activity in the manifest (I'm using Sherlock Library):

android:theme="@style/Theme.Sherlock.Dialog"

And the Activity is looking exactly like a Dialog, but I can't find a theme to set on the buttons. What could I do?

Cœur
  • 37,241
  • 25
  • 195
  • 267
MagicMicky
  • 3,819
  • 2
  • 37
  • 53

1 Answers1

12

Alright, if you're developping an application for HC/ICS, without Sherlock, the answer is here : https://gist.github.com/2348305

Just theme using

style="?android:attr/buttonBarStyle"

for container,

style="?android:attr/buttonBarButtonStyle"

for buttons

and

android:divider="?android:attr/dividerHorizontal"
android:showDividers="middle"

for the root layout

MagicMicky
  • 3,819
  • 2
  • 37
  • 53
  • +1. And if you're supporting pre-Honeycomb devices, the comments on the Gist that you linked to are helpful. I found the first one to work better for my situation: https://gist.github.com/paour/2357306 – Aaron Sep 24 '13 at 16:17