setRequestedOrientation(Index); /**Index=0,左横屏 * Index=1,正竖屏 * Index=8,右横屏 * Index=9,倒竖屏 */只需在activity中添加这行代码,并更改其中的参数值即可。