如何在Android中以编程方式将adjustViewBounds设置为true?

Fan*_*ria 11 scaling android imageview

我想以编程方式adjustViewBounds将my的属性设置ImageView为true,而不是XML.如何才能做到这一点?