Android layout make only one view draw itself as t

2019-07-15 16:11发布

问题:

The main view element in the layout for my activity is a VideoView. My video is rendered to the landscape resolution of the device, but all of the content in the video is sideways, so its still meant to be viewed while the device is in the portrait position even though I have to set my activity to android:screenOrientation="landscape" in my manifest (I have to do that or else the video doesn't take up the full screen). My question is: Is it possible for me to set a parameter on my video view that tells it to use landscape mode but have everything else that happens in my app be oriented for portrait mode? Similar to the android:orientation="horizontal/vertical" tag for LinearLayouts.

回答1:

My question is: Is it possible for me to set a parameter on my video view that tells it to use landscape mode but have everything else that happens in my app be oriented for portrait mode?

No, sorry.

On Android 3.0, you could try playing around with android:rotation, but I fear that this may slow things down tremendously. Plus, of course, it's only on 3.0.