高洛峰2017-04-17 17:21:56
Once you get RecyclerView
item
的视图对象,直接调用getWidth()
, you will naturally get its width.
PHP中文网2017-04-17 17:21:56
recyclerView.getLayoutManager().getChildAt(0).getHeight();
Get the item of the specified postition
阿神2017-04-17 17:21:56
The score of this question was answered:
If the view is ready (i.e. the view is visible), find the ItemView and call getWidth() directly
If the view is not ready, you need to use View#post(Runnable) to achieve it, ----Call getWidth() in run()