开发者

How to get View's position inside ViewGroup?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜