如何在代码中使用毕加索设置背景图像

如何在代码中使用毕加索设置背景图像,第1张

如何在代码中使用毕加索设置背景图像

使用毕加索的回调

    Picasso.with(getActivity()).load(R.drawable.table_background).into(new Target(){  @Override  public void onBitmapLoaded(Bitmap bitmap, LoadedFrom from) {     mainLayout.setBackground(new BitmapDrawable(context.getResources(), bitmap));  }  @Override  public void onBitmapFailed(final Drawable errorDrawable) {      Log.d("TAG", "FAILED");  }  @Override  public void onPrepareLoad(final Drawable placeHolderDrawable) {      Log.d("TAG", "Prepare Load");  }      })

更新:

也请检查此内容。如评论中提到的@OlivierH。



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5479053.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-12
下一篇 2022-12-12

发表评论

登录后才能评论

评论列表(0条)

保存