Android - combine multiple images into one ImageView

后端 未结 3 2124
别跟我提以往
别跟我提以往 2020-12-17 00:33

I\'m looking for help developing (or a library) which can allow me to merge together multiple images into one imageview.

My application is grouping together interact

3条回答
  •  天命终不由人
    2020-12-17 01:22

    You can use MultiImageView.

    Add dependency in app.gradle:

    compile 'com.github.stfalcon:multiimageview:0.1'
    

    Add MultiImageView to layout xml file

    
    

    In java class find view by id:

    final MultiImageView multiImageView = (MultiImageView) findViewById(R.id.iv);
    

    For adding image to MultiImageView use method addImage(Bitmap bitmap). For exapple:

    multiImageView.addImage(BitmapFactory.decodeResource(getResources(), R.drawable.avatar1));
    

    For setting shape of MultiImageView use method setShape(MultiImageView.Shape shape).

    multiImageView.setShape(MultiImageView.Shape.RECTANGLE);//Rectangle with round corners
    multiImageView.setShape(MultiImageView.Shape.CIRCLE);//Circle
    multiImageView.setShape(MultiImageView.Shape.NONE);//Without shape
    


    Check github link for more information:

    I think it is what you needed

提交回复
热议问题