android 横竖屏切换 简记

时间:2014-08-13 15:02:36   收藏:0   阅读:416

横竖屏切换,不重新加载

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

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!