android 动态添加ImageView 设置setPadding不起作用问

imageView = new ImageView(this); 
imageView.setLayoutParams(new LayoutParams(20,20)); 
imageView.setPadding(20, 0, 20, 0);

设置ImageView的setPadding(20, 0, 20, 0); 不起作用

改为

            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(25, 25); 

            params.setMargins(15, 0, 15, 0);

            ImageView imageView = new ImageView(this);

            imageView.setLayoutParams(params);

            imageViews[i] = imageView;


转载地址:

http://www.cnblogs.com/freexiaoyu/archive/2013/04/10/3012135.html

你可能感兴趣的:(android 动态添加ImageView 设置setPadding不起作用问)