setScaleType to ScaleType.MATRIX programmatically not work but in xml it work

后端 未结 2 1542

this is my code :

    LinearLayout imageViewParent = (LinearLayout) findViewById(R.id.imageViewParent);
    ImageView view = new ImageView(this);
    imageViewPa         


        
相关标签:
2条回答
  • 2021-02-20 09:10

    Use this:

    view.setImageResource(R.drawable.np);
    
    0 讨论(0)
  • 2021-02-20 09:21

    You should use setImageResource not setBackgroundResource.

    0 讨论(0)
提交回复
热议问题