首页 > 其他 > 详细

setRequestedOrientation设置屏幕方向

时间:2015-09-24 14:40:31      阅读:302      评论:0      收藏:0      [点我收藏+]
void android.app.Activity.setRequestedOrientation(int requestedOrientation)
 
官方API解释:
    Change the desired orientation of this activity. If the activity is currently in the foreground or otherwise impacting the screen orientation, the screen will immediately be changed (possibly causing the activity to be restarted). Otherwise, this will be used the next time the activity is visible.
 
中文大意:
    改变activity的期望的方向。如果activity 目前在前台或以其他方式影响屏幕的方向,屏幕将立即被改变(可能导致活动重新启动)。否则,这将在activity 下一次可见时使用。
 

//设横屏
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

setRequestedOrientation设置屏幕方向

原文:http://www.cnblogs.com/shenchanghui/p/4835165.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!