如何使用Glide库将Bitmap加载到我的ImageView中?我想用文本创建自定义图像,并使用Glide将其加载到imageview中.
这是我用文本创建自定义位图的方法
public Bitmap imageWithText(String text) {
TextView tv = new TextView(context);
tv.setText(text);
tv.setTextColor(Color.WHITE);
tv.setBackgroundColor(Color.BLACK);
tv.setTypeface(null, Typeface.BOLD);
tv.setGravity(Gravity.CENTER);
tv.setTextSize(20);
tv.setPadding(0, 25, 0, 0);
Bitmap testB = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(testB);
tv.layout(0, 0, 100, 100);
tv.draw(c);
return testB;
}
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试使用滑动加载此位图时,我收到错误
Glide.with(getContext()).load(imageWithText("Random text")).into(holder.imgPhoto);
Run Code Online (Sandbox Code Playgroud) 是否可以在标准UITableView中像单元格之间建立距离?没有选择让分隔符更大.这也是左右两边的距离.

android ×1
bitmap ×1
ios ×1
iphone ×1
java ×1
objective-c ×1
swift ×1
transition ×1
uitableview ×1
xcode ×1