如何动态改变ImageView的大小? [英] How to Change size of ImageView Dynamically?

查看:219
本文介绍了如何动态改变ImageView的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个动态表,其行包含一个imageview和一个textview。我的问题是这个imageview是采取全尺寸的原始图像,但我想更改imageview的大小。我已经使用setLayoutParams这没有任何效果。
作为替代,我也使用textview而不是imageview并将图像设置为textview的背景,并使用setWidth和setHeight,但它也有同样的问题。
Plz帮我

I am creating a dynamic table whose rows contains a imageview and a textview. My problem is this imageview is taking full size of original image but I want to change the size of imageview.I have used setLayoutParams which has no effect. As an alternative I also used textview instead of imageview and set image as textview's background and used setWidth and setHeight but it has the same problem. Plz Help Me.

推荐答案

确定我找到解决方案

以编程方式在TableLayout中调整ImageView

这篇关于如何动态改变ImageView的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆