ApiDemos学习笔记App-Activity篇(2)——Custom Dialog
这个示例通过在Manifest中设置主题,从而使Activity中的布局实现主题中设置的各类属性。

android:theme="@android:style/Theme.Dialog"
这个是在Manifest中定义主题的方式,通过设置Manifest中标签的android:theme属性,调用设置在res/styles文件夹中的Style,android也自带了许多style供开发者使用。style的设置和调用方便了View和ViewGroup的设置,很容易实现复用。
<style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/filled_box</item>
</style>