📜  使用毕加索加载背景图像 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:22.277000             🧑  作者: Mango

代码示例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");
  }      
})