0
A
回答
4
在你AndroidMainfest.xml把屏幕方向您飞溅
<activity
android:name=".SplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
4
在清单中,您可以设置特定的活动是利用
android:screenOrientation="portrait"
4
只需添加下面一行是在肖像模式在您的清单文件中,在飞溅活动标记
android:screenOrientation="portrait"
类似下面
<activity
android:name=".SplashActivity"
android:screenOrientation="portrait" >
4
添加到您的溅活动申报清单中的这段台词:
<activity
android:name="SplashActivity"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
找到相关的讨论here。下面的代码到你的闪屏活动申报清单
<activity android:name=".YourActivityName"
android:label="@string/app_name"
android:configChanges = "orientation"
android:screenOrientation = "portrait">
或者添加
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
到YourActivity.onCreate()
你可以找到一个示例演示文件here in github
2
添加在清单中,为你的设置毛绒屏幕活动:
<activity android:name=".YourActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
4
5
添加清单文件 - >
<application
.........
>
<activity
android:name=".SplashScreenActivity"
......
android:screenOrientation="portrait"
/>
</application>
或横向模式
<activity
...
...
android:screenOrientation="landscape">
3
您可以通过几种方式做到这一点
一
内,您的活动onCreate
方法
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
两个
在manifest file
<activity
android:name=".NameOfYourSplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
希望它可以帮助
0
尝试这种在manifiest
<activity
android:name=".SplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"/>
相关问题
- 1. Android启动画面旋转或旋转
- 2. 如何禁用iPhone应用程序的自动旋转?
- 3. 在Android应用程序中使用启动画面的启动顺序
- 4. 每次启动Android应用程序时显示启动画面
- 5. 如何禁用所有自动启动应用程序
- 6. 如何禁用任何自动旋转?
- 7. 如何在iOS上旋转自定义启动画面?
- 8. 在Windows 8应用程序中自动启动动画
- 9. 禁用Android图像自动旋转
- 10. 如何在angularjs phonegap应用程序中显示启动画面?
- 11. 模拟器启动画面中的iOS应用程序旋转90度
- 12. Android应用程序自动启动
- 13. Android应用程序自动启动
- 14. android自动启动应用程序
- 15. Android自动启动应用程序
- 16. IBM Worklight - 如何禁用启动画面?
- 17. 如何禁用SDL启动画面?
- 18. 禁用自动旋转
- 19. 禁用自动旋转
- 20. 如何在iPad应用程序的启动画面中进行动画制作?
- 21. 如何禁用Android应用程序在崩溃后自动重启(Android 2.2)
- 22. 设置自动旋转启用/禁用Android
- 23. [ios.cocos2d + box2d]如何禁用自动旋转?
- 24. 如何禁用并启用swift自动旋转?
- 25. 如何禁用或启用自动旋转?
- 26. 如何集成启动画面活动和应用程序
- 27. 在android中旋转动画
- 28. 如何在Android中启动Hotspot时自动启动我的应用程序
- 29. 在Cocos2d中禁用自动旋转
- 30. 以编程方式启用和禁用自动旋转?
网上有很多答案可供选择。您必须在发布任何问题之前进行搜索。 – UchihaSasuke
[将Android手机应用程序锁定到肖像模式]的可能重复(http://stackoverflow.com/questions/5044544/lock-android-phone-application-to-portrait-mode) – Renjith