为了账号安全,请及时绑定邮箱和手机立即绑定

如何避免出现“ IllegalStateException:Scrollview只能容纳一个直

如何避免出现“ IllegalStateException:Scrollview只能容纳一个直

PIPIONE 2019-10-21 14:37:27
我ScrollView在Android版式中使用它,但显示IllegalStateException "Scrollview can host only one direct child"如何避免这种异常?崩溃信息:07-19 15:58:22.308 21372 21372 D AndroidRuntime: Shutting down VM07-19 15:58:22.313 21372 21372 E AndroidRuntime: FATAL EXCEPTION: main07-19 15:58:22.313 21372 21372 E AndroidRuntime: Process: com.languoguang.helloworld, PID: 2137207-19 15:58:22.313 21372 21372 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.languoguang.helloworld/com.languoguang.helloworld.plugin_homeadd.activity.AddDeviceWifiSettingActivity}: android.view.InflateException: Binary XML file line #254: ScrollView can host only one direct child07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3190)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3285)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.-wrap12(Unknown Source:0)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:108)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:166)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7412)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:926)07-19 15:58:22.313 21372 21372 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #254: ScrollView can host only one 
查看完整描述

3 回答

?
波斯汪

TA贡献1811条经验 获得超4个赞

您可以IllegalStateException :Scollview can host only one direct child通过在滚动视图中仅托管一个直子来避免


查看完整回答
反对 回复 2019-10-21
  • 3 回答
  • 0 关注
  • 526 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信