我是参考这篇文章 :https://www.jianshu.com/p/dbc7e81aead2
主要是布局分横竖屏
然后再java代码
Configuration cf = this.getResources().getConfiguration(); int ori = cf.orientation; if (ori == cf.ORIENTATION_LANDSCAPE) { setContentView(R.layout.feedback_list); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else if (ori == cf.ORIENTATION_PORTRAIT) { setContentView(R.layout.feedback_list); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);//竖屏 }