Ant*_*vza 11
您可以使用MultiImageView.
在app.gradle中添加依赖项:
compile 'com.github.stfalcon:multiimageview:0.1'
Run Code Online (Sandbox Code Playgroud)
将MultiImageView添加到布局xml文件
<com.stfalcon.multiimageview.MultiImageView
android:id="@+id/iv"
android:layout_width="100dp"
android:layout_height="100dp"/>
Run Code Online (Sandbox Code Playgroud)
在java类中按id查找视图:
final MultiImageView multiImageView = (MultiImageView) findViewById(R.id.iv);
Run Code Online (Sandbox Code Playgroud)
要将图像添加到MultiImageView,请使用方法addImage(位图位图).对于exapple:
multiImageView.addImage(BitmapFactory.decodeResource(getResources(), R.drawable.avatar1));
Run Code Online (Sandbox Code Playgroud)
对于设置MultiImageView的形状,请使用方法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
Run Code Online (Sandbox Code Playgroud)
检查github链接以获取更多信息:
我认为这是你需要的
| 归档时间: |
|
| 查看次数: |
5324 次 |
| 最近记录: |