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”

即可解决

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

Copyright © 2014-2025 奋奋的愤愤 | 京ICP备14029030号-1