开发者

How to position item of ListView?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜