对话主题活动:正面和负面按钮 [英] Dialog themed activity : positive and negative buttons

查看:92
本文介绍了对话主题活动:正面和负面按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将活动定义为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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆