此控件为一个项目中用到的,要求做一个货架与货物对应的界面效果,于是找UI做了个背景图和货物图片,做出这样的效果
添加 JitPack repository 到你的build文件
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
增加依赖
dependencies {
implementation 'com.github.wuxinlingluan:CargoView:v1.0'
}
使用
<com.github.view.CargoView
android:id="@+id/gf1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
设置货架数据
CargoView gf1 = (CargoView) findViewById(R.id.gf1);//初始化
List<PointBean> pointList1=new ArrayList<>();//集合
gf1.setGoodsList(pointList1);//设置数据