jjzjj

screenOrientation

全部标签

应用程序中的 android:screenOrientation 标签不起作用

android:screenOrientation放置在中时标记不起作用。但是当我把android:screenOrientation在标记它有效。如果android:screenOrientation标签适用于那么,就没有必要把android:screenOrientation处理每个Activity。我想知道,为什么在Android平台上对于screenOrientation会有这样奇怪的行为?标签? 最佳答案 元素不支持android:screenOrientation.你可以通过readingthedocumentation

android - screenOrientation portrait 和 userPortrait 有什么区别

我需要知道屏幕方向userPortrait和portrait的真正区别。什么时候用什么?什么时候?android:screenOrientation="portrait"什么时候?android:screenOrientation="userPortrait" 最佳答案 "portrait"Portraitorientation(thedisplayistallerthanitiswide).和"userPortrait"Portraitorientation,butcanbeeithernormalorreverseportrai

Android:禁用旋转 90°,但启用旋转 180°

我想创建一个只能横向显示的Android应用程序(适用于平板电脑),例如该应用应忽略90°的旋转,但支持180°的旋转。在list中添加android:screenOrientation="landscape"会导致应用忽略所有旋转(即使是180°旋转),即,将设备旋转180°会显示应用上下颠倒。如果没有android:screenOrientation属性,我的应用程序将在所有四个位置“正确”显示。将设备旋转180°会垂直翻转UI。水平。旋转设备时会创建以下日志消息(也许这有帮助?):[...]:INFO/WindowManager(1290):Settingrotationto1,

android:screenOrientation ="portrait"在 Jellybean 中被忽略

android:screenOrientation="portrait"在Jellybean中被忽略。如果我Handlebars机变成横屏,它无论如何都会改变方向。我试过好几部手机。我必须使用任何新标志吗? 最佳答案 您可以尝试以编程方式进行,@OverridepublicvoidonConfigurationChanged(ConfigurationnewConfig){super.onConfigurationChanged(newConfig);switch(newConfig.orientation){caseConfigu

android - 将 screenOrientation 设置为纵向不起作用

我想以纵向模式运行我的应用程序,我知道这不是最佳做法,但有理由这样做。虽然我禁用了旋转,但它仍然可以在某些View上旋转,而在其他View上则不能。我的AndroidManifest中有这部分代码:.app.MainActivity"android:label="@string/app_name"android:configChanges="keyboardHidden|keyboard|locale|orientation"android:screenOrientation="portrait">我使用fragment根据用户输入显示不同的容器。这是唯一有fragment的Activ

java - 如何使用@ActivityInfo.ScreenOrientation

我尝试创建一个方法,它返回屏幕方向依赖于无论设备是手持设备还是平板电脑。publicintgetScreenOrientation(booleanisTablet){if(isTablet){returnActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;}else{returnActivityInfo.SCREEN_ORIENTATION_PORTRAIT;}}但是当我使用setRequestedOrientation(getScreenOrientation));我得到一个lint-errorMustbeoneof:ActivityInfo.SCRE

android:screenOrientation =“sensorPortrait"无效?

我需要限制我的应用以纵向模式显示。使用android:screenOrientation=“Portrait”效果很好,但我想在设备旋转时将显示更改为反转纵向。使用android:screenOrientation="sensorPortrait"会导致编译错误。有趣的是,如果我改用“sensorLandscape”,它编译得很好,但这不是我需要的。我在Android2.3.3上使用Eclipsev3.7.2有什么想法吗???谢谢罗布 最佳答案 Google打错了,使用sensorPortait

android - 将 Android 手机应用程序锁定为纵向模式

谁能告诉我如何将我的应用程序锁定为纵向模式?是manifest文件中的简单配置吗? 最佳答案 是的。将android:screenOrientation="portrait"添加到主要Activity下的list中。 关于android-将Android手机应用程序锁定为纵向模式,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/5044544/

android - 将 Android 手机应用程序锁定为纵向模式

谁能告诉我如何将我的应用程序锁定为纵向模式?是manifest文件中的简单配置吗? 最佳答案 是的。将android:screenOrientation="portrait"添加到主要Activity下的list中。 关于android-将Android手机应用程序锁定为纵向模式,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/5044544/

android - 为什么 `android:screenOrientation="后面"` 在 android 4.1.2 中没有效果?

作为一个测试示例,有一个应用程序有2个Activity:MainActivity,它在按钮单击时启动SecondActivity。它在Android4.0.4上运行良好,但在Android4.1.2上我遇到了意外行为。系统设置中的AutoRotation已关闭(或已打开-没关系,“后面”选项无论如何都会被忽略)。android:screenOrientation="landscape"设置为MainActivity并且android:screenOrientation="behind"设置为SecondActivity,这意味着SecondActivity也必须横向启动。对于Andro