开发者

Adding Views to an Android Viewgroup Programmatically

开发者 https://www.devze.com 2023-04-10 08:26 出处:网络
This seems to be a common question yet documentation is very hard to find. I\'m looking for examples that show me how to create my own view group (preferably by extending an already existing one) and

This seems to be a common question yet documentation is very hard to find. I'm looking for examples that show me how to create my own view group (preferably by extending an already existing one) and then add views 开发者_如何学Pythonprogrammaticly.

Thanks.


ViewGroup

ViewGroup is abstract, and its onLayout is abstract too. So you need to provide an implementation for onLayout where you do assign a position at every child (View) of the viewgroup.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号