【发布时间】:2016-05-23 22:03:54
【问题描述】:
屏幕顶部的背景使用以下主题,并且应该是透明的。在纵向模式下,背景变为黑色。有时这甚至不会发生,背景保持透明。为了测试这一点,我正在使用 TED 文本编辑器应用程序。正如我所说,在 TED 中,纵向模式下背景会变黑。我编写了自己的活动,该活动具有多行文本输入字段,并且在此活动中,背景正确显示。在另一个示例中,当我尝试撰写新电子邮件时,Gmail 应用中的背景在纵向模式下变为白色。
我也在下面展示了一些 IME 的布局。
<resources>
<!-- some styles here -->
<style name="AppTheme.Custom" parent="AppTheme.NoActionBar">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent" >false</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:colorBackgroundCacheHint">@android:color/transparent</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowContentOverlay">@android:color/transparent</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>
</resources>
这是 IME 的一些布局:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:theme="@style/AppTheme">
<LinearLayout
android:background="#00000000"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:theme="@style/AppTheme.Custom"
android:layout_gravity="top"
android:id="@+id/topHalf"></LinearLayout>
<include layout="@layout/content_main"
android:layout_weight="0.5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/AppTheme"
android:layout_gravity="bottom"
/>
</LinearLayout>
</FrameLayout>
【问题讨论】:
标签: android android-theme android-input-method