ScrollView仅支持一个子项,报错ScrollView can host only one direct child
LogCat 报错信息:
发生错误原因分析:
ScrollView仅支持一个子项。
查看对应的layout xml,发现ScrollView中有两个子项。
解决办法:
在ScrollView 中设LinearLayout为子项 ,将其它View放入LinearLayout。
PS. 在Error Log中有错误提示。但在编辑layout xml 时未开启“Error Log”窗口,未发现报错。
其实“Graphical Layout” 中也会有报错提示