首页 » 未分类 » 正文

android 布局文件提示错误“No orientation specified, and the default is horizontal. This is a common source of bugs when children are added dynamically.”

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

 children are added dynamically.

发生这个错误提示的原因是<LinearLayout>要指明方向,水平方向(horizontal )还是垂直方向( vertical ),而这个布局文件没有指明,因此会导致该错误信息发生。

解决办法:

只要在<LinearLayout>添加上

 android:orientation = “vertical”

 android:orientation = “horizontal”

即可解决

发表评论