Android Q&A | No orientation specified, and the default is horizontal,

来源:互联网 发布:ff14龙男捏脸数据身高 编辑:程序博客网 时间:2024/06/06 03:38

Question:

错误提示信息为:No orientation specified, and the default is horizontal. This is a common source of bugs when

 children are added dynamically.


Answer:

问题原因:线性布局无法定位其方向性,而在使用<LinearLayout>标签要指明方向

通常发生这个错误提示的原因是我们直接在原有的页面上把别的布局标签改成<LinearLayout>,但是使用<LinearLayout>标签要指明方向,水平方向horizontal还是垂直方向vertical,所以直接修改,会导致没有指名线性布局的方向,

解决方案:

添加上

 android:orientation = "vertical"

 android:orientation = "horizontal"



0 0
原创粉丝点击