无取向通知时半透明集 [英] no orientation notification when translucent set

查看:131
本文介绍了无取向通知时半透明集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用具有电话 Android 2.1系统和放大器; 2.2 安装,使用一个Hello World应用程序的简单的情况下,并添加安卓主题=@安卓风格/ Theme.Translucent以在Android清单到活动已应用程序是透明的,应用程序枝人像只有当手机旋转时不会旋转为横向。

Using phones that have android 2.1 & 2.2 installed, using the simplest case of a hello world app and add android:theme="@android:style/Theme.Translucent" to the activity in the android manifest to have the app be transparent, the app sticks as portrait only and won't rotate to landscape when the phone is rotated.

乘坐线路输出和应用旋转确定。这是通过添加onConfigurationChanged的覆盖,并把一个断点在例行验证。当不施加半透明的,当您添加半透明BRK命中,没有。

Take the line out and the app rotates ok. This is verified by adding the override of onConfigurationChanged and putting a breakpoint in that routine. Brk hits when translucent isn't applied, doesn't when you add translucency.

然而,使用三星Galaxy使用的Andr​​ 2.2 标签,轮换工作确定,即使应用透亮。任何人有任何想法?

However, using a samsung galaxy tab using andr 2.2, rotation works ok even with translucent applied. Anyone have any ideas on this?

推荐答案

我有同样的问题。在manifest文件screenOrientation =传感器指定的主题后:只需添加的android

I had a same problem. Just add android:screenOrientation="sensor" in the manifest file after you specify theme:

    <activity
        android:name=".SplashActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"
        android:screenOrientation="sensor">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

到目前为止,我测试了它在Android 2.2和4.1 - 按预期工作

So far I tested it on android 2.2 and 4.1 - works as expected.

这篇关于无取向通知时半透明集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆