问题
Consider the following image as an example:
- Landscape mode
In Landscape mode, there are 2 sides viz- left side containing fragment 1
and right side containing fragment 2
.
The left side (fragment 1) view is fine meaning - buttons are proper, text is coming with right alignment without any overlap/mix with other text.
The right side (fragment 2) view is a chart and its format is not coming correct on the 7' screen. Chart font covers the sides of the grid (on both sides of the grid), chart buttons are narrowed to a single letter.
- Portrait mode
In portrait mode, there is only 1 side viz - right side only containing fragment 2
.
The 7' screen (tablet device) is small enough in portrait mode that although there is only one fragment (fragment 2) containing chart, but this chart is having same problems as with landscape mode.
Is it possible to reduce the right side chart in landscape mode to get proper view without any text mixing with the chart Or how to do the same for portrait mode?
Any alternatives or ideas?
I found that there is no auto adjustment of views according to orientations although I have proper folders-
res/layout-large/activity_main.xml and res/layout-large-land/activity_main.xml.
where
res/layout-large/activity_main.xml
- Showing portrait orientation view.
res/layout-large-land/activity_main.xml
- Showing landscape orientation view.
来源:https://stackoverflow.com/questions/17103026/canvas-containing-bitmap-size-proper-adjustment-in-landscape-and-portrait-mode