在Android应用程序中设置主题

时间:2015-04-29 23:47:14

标签: android

我经历了相当多的事情,我仍然对自己需要做的事情感到茫然:

http://developer.android.com/design/style/themes.html http://developer.android.com/guide/topics/ui/themes.html

我将视图设置为在我的IDE(IntelliJ IDEA 14.1.2)中使用“Dialog”主题,并且应用程序在insepctor中看起来像这样:

enter image description here

然而,在我的手机上看起来完全不同(更大的分辨率,但这不是重点)。

enter image description here

我做错了什么,我怎么能得到这种效果?

2 个答案:

答案 0 :(得分:0)

添加到Android清单

tr {
    position: relative;
    z-index: 1;
}

td {
    position: relative;
    z-index: initial;
}

div {
    position: absolute;
    z-index: -1;
}

答案 1 :(得分:0)

我在我的一个活动中使用它并且没关系:

        <activity
        android:name="eddine.charef.mechalikh.swipedemo.mapDialog"
        android:excludeFromRecents="true"
        android:launchMode="singleInstance"
        android:theme="@android:style/Theme.Dialog" ><!--add this-->
        </activity>

也许你的Android版本不支持。