如何避免" IllegalStateException异常:滚动型只能承载一个直接子"? [英] How can I avoid "IllegalStateException: Scrollview can host only one direct child"?

查看:172
本文介绍了如何避免" IllegalStateException异常:滚动型只能承载一个直接子"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Andr​​oid的布局使用滚动型,但它显示了

I am using ScrollView in my Android Layout but it shows

IllegalStateException异常滚动型只能承载一个直接子

我怎样才能避免这种例外?

How can I avoid this exception?

推荐答案

您已经添加了一个以上的控件滚动型的孩子。如果你想这样做,添加的LinearLayout作为一个直接的孩子,把其他的控制它。

You have added more than one controls as children of a ScrollView. If you want to do this add a LinearLayout as a direct child and put the other controls in it.

这篇关于如何避免" IllegalStateException异常:滚动型只能承载一个直接子"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆