col*_*-23 2 android themes screen-orientation
使用已android 2.1 & 2.2
安装的手机,使用最简单的hello world应用程序并将 android:theme ="@ android:style/Theme.Translucent"添加到android清单中的活动以使应用程序透明,该应用程序坚持为肖像仅旋转电话时不会旋转到横向.
拿出线,应用程序旋转正常.这可以通过override of onConfigurationChanged
在该例程中添加和放置断点来验证.Brk在未应用半透明时命中,在添加半透明时不会.
但是,使用andr 2.2使用三星星系标签,即使使用半透明,旋转也能正常工作.任何人对此都有任何想法?
我遇到了同样的问题.在指定主题后,只需在清单文件中添加android:screenOrientation ="sensor":
<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>
Run Code Online (Sandbox Code Playgroud)
到目前为止,我在Android 2.2和4.1上测试了它 - 按预期工作.
归档时间: |
|
查看次数: |
805 次 |
最近记录: |