문제

I am having a VideoView playing video on my Android app. When I try it on the portrait orientation, the video fills the screen. But when I change the orientation to landscape, the video takes up only half the screen space. I am using FILL_PARENT, FILL_PARENT as the layout parameters.

Is there a way I can have the video fill the screen in both orientations?

도움이 되었습니까?

해결책

Your video might be just too small. You can center it in parent to make it look better. Or try to request bigger video from your provider.

다른 팁

If it fills the screen perfectly in portrait mode how will it ever fit perfectly in landscape mode without changing the aspect ratio?

The same goes for the reverse - if it fits perfectly in landscape mode, when you change to portrait it won't take up all the vertical space.

You might consider making two different layouts for portrait and landscape views. Let's assume you have "/res/layout/main.xml" file. In the "/res/" folder make a child folder and name it "layout-land", the R file is going to be automatically generated! Here is a snapshot just to make it easier...

alt text http://img826.imageshack.us/img826/5749/previewu.png

after you can edit each layout independently... This is the most common way of working with orientation change, when it comes to layouts.

Best regards,

Igor

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top