public void switchOrientation(View v){ int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_PORTRAIT){ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else{ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } }
Android实现横屏与竖屏之间的转换
最新推荐文章于 2021-05-26 22:45:25 发布