ViewGroup.LayoutParams params = listview1.getLayoutParams(); params.height = hello.length*(高度); listview1.setLayoutParams(params); 高度根据屏幕大小判断。