按钮在自动旋转的Android中相对布局重叠 [英] buttons get over lapped in relative layout in android on Auto Rotate

查看:149
本文介绍了按钮在自动旋转的Android中相对布局重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个相对布局,里面有几个按钮。当自动旋转发生时,所有按钮都重叠。我可以避免这种情况,以便所有控件在自动旋转时保持完好吗? ?



任何帮助都会非常感激。



谢谢



谢谢

Hi all,
I have a relative layout with several buttons in it.When auto rotate happens all buttons get overlapped.how can i avoid that so that all the controls remain intact on auto rotate??

Any help would be really appreciated.

Thanks

Thanks

推荐答案

然后你应该为相同的布局创建2个不同的文件,一个用于纵向布局,另一个用于横向布局。

所以现在,如果您有一个名为 temp.xml 的布局文件(用于纵向视图),请创建另一个文件并将其命名为 temp_land.xml



android框架将理解这两个文件之间的区别,并在每种模式下加载相应的文件。







-KR
Then you should create 2 different files for the same same layout, one is for Portrait layout, and another is for Landscape layout.
So right now, if you having a layout file named as temp.xml (for portrait view), create another file and name it as temp_land.xml.

The android framework will understand the difference between these two files, and load the appropriate file in each of the modes.



-KR


这篇关于按钮在自动旋转的Android中相对布局重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆