对话主题活动:正面和负面按钮 [英] Dialog themed activity : positive and negative buttons
问题描述
我正在尝试将活动定义为AlertDialog
.我面临的问题是我找不到在窗口底部放置两个按钮的方法,这些按钮看起来像AlertDialog
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
我已经将该行添加到清单中的活动"中(我正在使用Sherlock库):
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?
推荐答案
好的,如果您正在开发不带Sherlock的HC/ICS应用程序,那么答案就在这里: https://gist.github.com/2348305
Alright, if you're developping an application for HC/ICS, without Sherlock, the answer is here : https://gist.github.com/2348305
仅使用
style="?android:attr/buttonBarStyle"
对于容器,
style="?android:attr/buttonBarButtonStyle"
用于按钮
和
android:divider="?android:attr/dividerHorizontal"
android:showDividers="middle"
用于根布局
这篇关于对话主题活动:正面和负面按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!