How to add a dynamically created LinearLayout to a ScrollView?

不打扰是莪最后的温柔 提交于 2019-12-06 05:46:52

Because Java is case sensitive? AddView() != addView(). Also (though not the root of the problem), note that a ScrollView can only have one child.

It's addView(), not AddView(). Or was that just a typo in your question?

Is your problem solved by the dmon's answer?

Be sure that yout have correct the spealing of the addView(). java is case sensitive. addView() and AddView() both are different thing.

Also make sure that your are adding ScrollView to the OneParent Layout. As Because you can able to add the ScrollView to the Only One Parent Layout.

So, supose you have two layout like LinearLayout and RelativeLayout and if you provide One ScrollView to the both layout then it will arrise error.

you have to add another layout as parent of both the layout and then add ScrollView to that parent layout.

Hope you got the point.

Thanks.

Enjoy. :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!