首页 > 移动平台 > 详细

android 横竖屏切换 简记

时间:2014-08-13 15:02:36      阅读:414      评论:0      收藏:0      [点我收藏+]

横竖屏切换,不重新加载

1、activity声明android:configChanges="orientation|keyboardHidden|screenSize"

Up to API 13 there was a new value to the configChanges attribute, screenSize

So if you‘re using large screens make sure to add screenSize in your configChanges attribute:

android:configChanges="orientation|keyboardHidden|screenSize"

2、Activity重写onConfigurationChanged

public void onConfigurationChanged(Configuration newConfig)  

     super.onConfigurationChanged(newConfig);  

 

--------------------------------------------------------------------------------------------

代码切换横竖屏
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

android 横竖屏切换 简记,布布扣,bubuko.com

android 横竖屏切换 简记

原文:http://blog.csdn.net/actsai/article/details/38535471

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