开发者

How to position item of ListView?

开发者 https://www.devze.com 2023-01-08 01:01 出处:网络
I have a ListView with number of items. I\'d like to place the item being clicked in the top of the screen. i am trying to use requestChildRectangleOnScreen of ListV开发者_运维百科iew that seems to do

I have a ListView with number of items. I'd like to place the item being clicked in the top of the screen. i am trying to use requestChildRectangleOnScreen of ListV开发者_运维百科iew that seems to do the job, however I cannot figure out how to properly specify the rectangle param. Any suggestion and/or code sample will be really helpful

Thanks a lot


You can get the rectangle of the view with getLeft() aso.

rectangle = new Rect(editText.getLeft(), editText.getTop(), editText.getRight(), editText.getBottom());
0

精彩评论

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

关注公众号