我在android项目中使用这个库,但使用https://github.com/igalata/Bubble-Picker/错误
获得Exception
而
item.setBackgroundImage(ContextCompat.getDrawable(MainActivity.this, images.getResourceId(0, 0))); of type PickerItem which takes a drawable parameter-
java.lang.ClassCastException:android.graphics.drawable.VectorDrawable无法转换为android.graphics.drawable.BitmapDrawable
BubblePicker bubblePicker; bubblePicker = findViewById(R.id.picker); bubblePicker.setAdapter(new BubblePickerAdapter() { @Override public int getTotalCount() { return titles.length; } @NotNull @Override public PickerItem getItem(int position) { PickerItem item = new PickerItem(); item.setTitle(titles[position]); item.setGradient(new BubbleGradient(colors.getColor((position * 2) % 8, 0),colors.getColor((position * 2) % 8 + 1, 0), BubbleGradient.VERTICAL)); item.setTypeface(mediumTypeface); item.setTextColor(ContextCompat.getColor(MainActivity.this, android.R.color.white)); item.setBackgroundImage(ContextCompat.getDrawable(MainActivity.this, images.getResourceId(position,0))); return item; } });
- 我需要什么软件和编程语言来创建应用程序?
- 反序列化包含数组的Firestore文档的推荐方法是什么?
- RxJava和Kotlin的花括号和正常括号有什么区别?
- 调用File.createNewFile()时,权限被拒绝 Android的
- Android Kotlin Mvp类代表团
- Kotlin的综合性质冲突
- 使用kotlin&greendao的Android Studio 3.0 Proguard将返回ClassLookupException
- kotlin翻新 – 背景粘性并发标记扫描GC释放65326(1448KB)AllocSpace对象,62(1736KB)LOS对象,
- Android Studio 3 Canary中未解决的参考