我有一个简单的Activity,希望它能呈现为圆角矩形。该Activity使用半透明的Drawable。我看到其他开发者创建了半透明(非对话框主题)且带有圆角的弹出窗口,我想要复制这个效果。任何帮助都将不胜感激。
以下是我目前拥有的代码,它可以在屏幕中央生成一个矩形的半透明窗口。
<style name="Theme.TranslucentDialog">
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<!-- Note that we use the base animation style here (that is no
animations) because we really have no idea how this kind of
activity will be used. -->
<item name="android:windowBackground">@drawable/translucent_background</item>
<item name="android:windowNoTitle">true</item>
<item name="android:colorForeground">#fff</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style>
<drawable name="translucent_background">#60000000</drawable>