动态改变imageview的大小设置
imag1.setImageResource(R.drawable.xx_ktzxlb); ViewGroup.MarginLayoutParams margin9 = new ViewGroup.MarginLayoutParams( imag1.getLayoutParams()); RelativeLayout.LayoutParams layoutParams9 = new RelativeLayout.LayoutParams(margin9); layoutParams9.height = ScreenUtils.dpTopx(getActivity(),54);//设置图片的高度 layoutParams9.width = ScreenUtils.dpTopx(getActivity(),51); //设置图片的宽度 imag1.setLayoutParams(layoutParams9);