imageView = new ImageView(NavigationActivity.this);
imageView.setLayoutParams(new LayoutParams(12,12));
imageView.setPadding(20, 0, 20, 0);
设置ImageView的setPadding(20, 0, 20, 0); 不起作用
改为
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(12, 12);
params.setMargins(0, 0,13, 0);
imageView = new ImageView(NavigationActivity.this);
imageView.setLayoutParams(params);