No orientation specified, and the default is horizontal.

本文详细解释了在Android开发中遇到的布局方向未指定导致的错误,提供了解决方案并强调了正确使用LinearLayout标签的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >



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

 children are added dynamically.


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>,但是使用<LinearLayout>标签要指明方向,水平方向还是垂直方向

horizontal or vertical

所以直接修改,会导致没有指名线性布局的方向,只要添加上

 android:orientation = "vertical"

 android:orientation = "horizontal"

即可解决

from:http://blog.youkuaiyun.com/sky_monkey/article/details/21466975

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值