【问题标题】:Dialog themed activity : positive and negative buttons对话主题活动:正面和负面按钮
【发布时间】:2012-06-28 21:44:04
【问题描述】:

我正在尝试将活动主题化为AlertDialog。我面临的问题是我找不到在窗口底部放置两个按钮的方法,这两个按钮看起来像AlertDialog 的正负按钮

我已经将该行添加到清单中的我的活动中(我正在使用 Sherlock 库):

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

Activity 看起来完全像一个对话框,但我找不到要在按钮上设置的主题。我能做什么?

【问题讨论】:

    标签: android android-dialog android-theme


    【解决方案1】:

    好的,如果您正在为没有 Sherlock 的 HC/ICS 开发应用程序,答案就在这里: https://gist.github.com/2348305

    只是主题使用

    style="?android:attr/buttonBarStyle"
    

    对于容器,

    style="?android:attr/buttonBarButtonStyle"
    

    按钮

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

    对于根布局

    【讨论】:

    • +1。如果您支持预蜂窝设备,那么您链接到的 Gist 上的 cmets 会很有帮助。我发现第一个更适合我的情况:gist.github.com/paour/2357306
    猜你喜欢
    • 2013-01-24
    • 2021-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多