我正在尝试将图像添加到椭圆形的shapeDrawable中

时间:2019-06-24 15:22:28

标签: java android android-image

我正在尝试添加图像,正在为Wheelview添加颜色,我想要的是图像而不是颜色。

String link = "https://www.google.com/search?q=game+controller+pic&source=lnms&tbm=isch&sa=X&ved=0ahUKEwisn8PmtYLjAhWOup4KHShvDOIQ_AUIECgB&biw=1368&bih=770#imgrc=Uqr-gNTd7e6UGM:";
for (int i = 0; i < size; i++){
  shapeDrawables[i] = new ShapeDrawable(new OvalShape());

//shapeDrawables[i].getPaint().setColor(Color.parseColor(colors[i]));

    }

这是Wheelview适配器

 wheelview.setAdapter(new WheelAdapter() {
        @Override
        public Drawable getDrawable(int position) {
            return shapeDrawables[position];
        }

        @Override
        public int getCount() {
            return size;
        }

    });

0 个答案:

没有答案