天天看點

Android判斷橫屏豎屏代碼

// 判斷Android目前的螢幕是橫屏還是豎屏。橫豎屏判斷
		if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
			//豎屏
		} else {
			//橫屏
		}           

this指針是目前Activity或者Context。

繼續閱讀