[英]screen mode in portrait the orientation issue in samsung mobile
我正在開發自定義相機應用程序,我不得不將屏幕模式設置為人像模式,但是來到三星移動時出現屏幕問題的方向。在三星手機中使用人像模式設置應用程序該怎么辦
請嘗試以下操作:在您的活動中,
/** Forces the application to run in portrait mode */
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
在你的manifest.xml中
<activity
android:name="yourActivityName"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
另外,如果您的應用程序在v2.2或更高版本上運行,則可以使用camera.setDisplayOrientation(90)將攝像頭方向旋轉為縱向。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.