Set size of ImageView in px at runtime

前端 未结 2 1686
星月不相逢
星月不相逢 2021-01-16 22:55

I want to put 8 image thumbs in one horizontal line, using the whole available width.
The images are retrieved from a webservice which lets me specify the dimensions.

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-16 23:17

    I'd suggest using this:

    widthPx = getWindowManager().getDefaultDisplay().getWidth();
    

提交回复
热议问题