How could I make the SurfaceView and Button have a different orientation in a Activity

Posted by ??? on Stack Overflow See other posts from Stack Overflow or by ???
Published on 2010-12-21T06:33:25Z Indexed on 2010/12/21 6:54 UTC
Read the original article Hit count: 200

Filed under:

I hava a simple program about video recording . I use the surfaceView to show the preview screen. and I also want to put some buttons on the screen.

I put all the component mentioned above into a XML file which is "ipcam.xml"

I use MediaRecorder , SurfaceView , SurfaceHolder to complete this program because the preview screen does not orientate correctly when I rotate my phone. so I use "setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);" but , the button in the program is always in LANDSCAPE direction . it will not auto change direction when I rotate my phone , but the preview is ok!!

so is there anyway to solve this problem.

Thank you all very much in advance.

© Stack Overflow or respective owner

Related posts about android