【发布时间】:2012-01-29 01:43:34
【问题描述】:
我在我的活动中使用了以下主题:
<style name="Theme.TranslucentDarkGrey" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/translucent_dark_grey</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
这给了我一个半透明的灰色背景来查看后面的活动,我面临的问题是我有一个没有填满父级的 EditText。如果我删除上面的主题,它会很好地填满。这是布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/body"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical" android:layout_weight="1"/>
</LinearLayout>
没关系用这个解决它:
<style name="Theme.TranslucentDarkGrey" parent="android:Theme.Translucent">
<item name="android:windowBackground">@color/translucent_dark_grey</item>
</style>
【问题讨论】:
-
检查这个问题,它可能对你有帮助:Android EditText Transparent Background