how to set framelayout to landscape even if my activity is in portrait mode in android 2.3.1

StackOverflow https://stackoverflow.com/questions/5461248

سؤال

i have an activity where i am opening a camera. i am using framelayout for camera preview. but i have to open camera in portrait mode which creating lot many problem, like small screen, rotation problem, can i set my framelayout to landscape even if my activity is in portrait mode

or if any idea for opening camera effectively in portrait mode will be appreciated

Thanks in advance

هل كانت مفيدة؟

المحلول

In API level 8 (v2.2), Camera contains a method called setDisplayOrientation. Call this method with 90 to rotate your camera display to portrait mode.

نصائح أخرى

Try editing your AndroidManifest.xml's activity declaration:

<Activity android:screenOrientation="landscape" ... />
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top