我正在开发一个 android 应用程序并且我正在使用被子视图库我只是想知道如何更改图像块的大小并允许我的图像适合屏幕边缘即删除所有边距如果有人可以帮助我请
我的 MainActivity 代码是
public class MainActivity extends Activity {
public QuiltView quiltView;
public ImageView icon1, icon2, icon3, icon4, icon5;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
quiltView = (QuiltView)findViewById(R.id.quilt);
quiltView.setChildPadding(1);
icon1 = new ImageView(this);
icon1.setImageResource(R.drawable.agri);
icon1.setScaleType(ScaleType.FIT_XY);
icon2 = new ImageView(this);
icon2.setImageResource(R.drawable.finanace);
icon2.setScaleType(ScaleType.CENTER_CROP);
icon3 = new ImageView(this);
icon3.setImageResource(R.drawable.health);
icon3.setScaleType(ScaleType.CENTER_CROP);
icon4 = new ImageView(this);
icon4.setImageResource(R.drawable.travel);
icon4.setScaleType(ScaleType.CENTER_CROP);
/*icon5 = new ImageView(this);
icon5.setImageResource(R.drawable.agriculture);
icon5.setScaleType(ScaleType.CENTER_INSIDE);*/
ArrayList<ImageView> images = new ArrayList<ImageView>();
images.add(icon1);
images.add(icon2);
images.add(icon3);
images.add(icon4);
//images.add(icon5);
quiltView.addPatchImages(images);
}
}