如何动态改变的ListView的高度andrtoid [英] how to change the height of the ListView dynamically in andrtoid

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

问题描述

我需要改变高度的ListView控件的动态在我的应用程序。

i need to change the height the of the ListView dynamically in my app.

有没有办法做到这一点。

Is there any way to do that.

推荐答案

改变高度和宽度动态等等,试试这个

for change height and width dynamically so, try this

RelativeLayout.LayoutParams mParam = new RelativeLayout.LayoutParams((int)(width),(int)(height);
        listView.setLayoutParams(mParam);

您也可以使用LayoutParams.FILL_PARENT或LayoutParams.WRAP_CONTENT,而不是身高和放大器;宽度

you can also use LayoutParams.FILL_PARENT or LayoutParams.WRAP_CONTENT instead of height & width

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

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