如何在代码中改变 ImageView的大小

myfuture20100 myfuture20100 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
如何在代码中改变 ImageView的大小, 我用 imageview.setMaxHeight(150); imageview.setMaxWidth(150);来设置好像不行, 下面是layout中的 ImageView
<ImageView android:id="@+id/imv_bg" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:maxWidth="200dip"
android:maxHeight="200dip"
android:scaleType="fitCenter" android:background="@drawable/wifi"
android:layout_marginTop="65dip" android:layout_centerHorizontal="true">
</ImageView>
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
myfuture20100
Android 80,490 成员 91,375 内容