开发者

How can I have a portrait-oriented menu in my landscape-oriented view in Android?

How can I have a portrait-oriented menu in my landscape-oriented view in Android?Hi,

I'm building an application with some items that must be landscape-oriented. Everything else (menu, view for editing the item, list of item...) should change orientation according to the orientation of the device. To do that I set android:screenOrientation="landscape" in the AndroidManifest.xml for the开发者_运维百科 activity showing my items. Now, how can I create a portrait-oriented menu for that activity?

I'm also wondering if setting the screen orientation of the activity is the only way? Isn't it possible to set the screenOrientation for each view?


Now, how can I create a portrait-oriented menu for that activity?

Draw it yourself using Canvas and 2D graphics drawing primitives. You will also need to process the low-level touch events, handle all pointing device events (e.g., trackball), handle all user feedback (e.g., flashing the menu choice when clicked), and so on.

You will also have to do this for everything else that you are trying to draw perpendicular to the screen orientation as well.

I am hoping you have a very large development team.

Isn't it possible to set the screenOrientation for each view?

No. Screen orientation is by the screen.

Whatever business problem you are trying to solve with mixed landscape-and-portrait, I suspect that you are trying to solve it the wrong way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜