开发者

How to get View's position inside ViewGroup?

开发者 https://www.devze.com 2023-02-07 04:43 出处:网络
I have a linear lay开发者_如何转开发out and some widgets inside it. How to get position of some widget inside linear layout, so i can then use removeViewAt(int positon) function?I think your confused

I have a linear lay开发者_如何转开发out and some widgets inside it. How to get position of some widget inside linear layout, so i can then use removeViewAt(int positon) function?


I think your confused about the removeViewAt method. It is not passed a position of a view, it is passed an index parameter. This index is the index of the child within the ViewGroup.

I don't think you can remove a view using position information. You would have to write some sort of method that decided which index to remove based on its positional information.

0

精彩评论

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