标签:
1.动态设置padding,拿ImageView为例:
ImageView imageView = new ImageView(this); imageView.setPadding(5,5,5,5)
2.动态设置margin
拿LinearLayout里边放ImageVIew例:
LinearLayout layout = (LinearLayout) convertView.findViewById(R.id.linearlayout); ImageView imageView = new ImageView(this); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(100, 100); params.setMargins(5, 5, 5, 5); layout.addView(imageView);
标签:
原文地址:http://www.cnblogs.com/zrui513/p/4969736.html