关于Wrong orientation? No orientation specified问题

来源:互联网 发布:网络锁是什么 编辑:程序博客网 时间:2024/06/06 10:50

创建一个android程序之后,发现xml文件头出现了这个错误:

Wrong orientation? No orientation specified, and the default is horizontal, yet this layout has multiple children where at least one has layout_width=match_parent


虽然问题不大,还是很经典,手动改了布局<LinearLayout>,但是没有写布局方向,在头文件属性中添加下面代码即可:

android:orientation="horizontal"。

发现错误没了。


我在程序中添加了一个按钮,但是运行后发现还是只有一行TextView,于是将代码改成:

android:orientation = "vertical"

问题解决!


上面的是横向代码,下面这个是纵向代码,线性排列需要给出横着排还是纵着排。


0 0
原创粉丝点击