为了澄清:我希望所有自定义对话框的外观都与系统默认对话框相同。例如,当用户使用htc sense时,对话框应该与htc sense对话框样式匹配;当用户使用官方定制版的三星手机时,对话框应该看起来像它。我想尽可能地本地化。我知道有修改对话框的可能性,但我正在寻找一种引用系统使用的样式并创建具有该样式的对话框的方法。
我的现状:
我想要实现的效果:
我的对话框布局代码,我使用dialog.setContentView(...)
调用:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@android:style/Theme.Dialog"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/listView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip" >
</ListView>
</LinearLayout>
可以看到设置style="@android:style/Theme.Dialog
并没有帮助。你有什么想法可能会有所帮助吗?
(我知道已经有这样的问题:https://stackoverflow.com/questions/6746535/android-custom-dialog-but-with-look-and-feel-of-default-one 但是还没有被接受的答案)