How to get the width and height of an android.widget.ImageView?

后端 未结 10 1932
长情又很酷
长情又很酷 2020-11-22 16:53
╔══════════════════════════════════════════════╗   ^
║ ImageView    ╔══════════════╗                ║   |
║              ║              ║                ║   |
║              


        
10条回答
  •  广开言路
    2020-11-22 17:23

    I could get image width and height by its drawable;

    int width = imgView.getDrawable().getIntrinsicWidth();
    int height = imgView.getDrawable().getIntrinsicHeight();
    

提交回复
热议问题