Android:API 8中的透明对话活动
我有问题 我试图将活动显示为对话框Android:API 8中的透明对话活动,android,dialog,android-activity,Android,Dialog,Android Activity,我有问题 我试图将活动显示为对话框 Intent intent = new Intent(this, CityOnMapDialog.class); intent.putExtra("city",cityString); startActivity(intent); 我在清单中声明如下: <activity android:name="com.example.myapp.dialogs.CityOnMapDialog" android:screenOrientati
Intent intent = new Intent(this, CityOnMapDialog.class);
intent.putExtra("city",cityString);
startActivity(intent);
我在清单中声明如下:
<activity android:name="com.example.myapp.dialogs.CityOnMapDialog"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Dialog"
android:windowIsTranslucent="false">
</activity>
有人能告诉我为什么这个对话框在API8中显示为透明的吗?我想这是因为主题
android:theme=“@android:style/theme.Dialog”
。它如何在更高的API级别上显示?我有更高的API,它是正常的,不透明的。。。你认为getWindow().setBackgroundDrawable(新的ColorDrawable(Color.parseColor(“#FF000000”))可以吗;你能帮忙吗?(对于背景上的黑色)#ff000000
是完全不透明的黑色。试试看,听起来很有希望。但是-主题仍然是旧的API 8样式之一,这可能会强制进行apha。如果您将支持库包括在项目中,您可以尝试:android:theme=“@android:style/theme.Holo.Dark.Dialog”
您可以在此处发布支持库的链接吗?请