如何使用滑动加载圆形appcompat操作栏徽标

时间:2016-08-09 08:19:45

标签: android android-actionbar android-actionbar-compat android-glide

直到现在我已经完成了以下操作,如果我省略圆形图像创建部分它工作正常,但我必须在动作栏中显示圆形图像

这是我到目前为止所尝试的,任何帮助都将受到高度赞赏

$temp = iconv_mime_decode($email['overview'][0]->subject,0,"ISO-2022-JP");
echo mb_convert_encoding($temp, "UTF-8", "JIS");

1 个答案:

答案 0 :(得分:2)

无法找到方法,切换到Picasso并将代码更改为以下

  Picasso.with(mContext)
                    .load(doctorDetailsList.get(0).getDoc_imgurl())
                    .resize(120, 120)
                    .centerCrop()
                    .placeholder(R.drawable.no_image)
                    .into(new com.squareup.picasso.Target()
                    {
                        @Override
                        public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from)
                        {
                            RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(mContext.getResources(), bitmap);
                            circularBitmapDrawable.setCircular(true);                             
                            getSupportActionBar().setLogo(circularBitmapDrawable);
                        }

                        @Override
                        public void onBitmapFailed(Drawable errorDrawable)
                        {

                        }

                        @Override
                        public void onPrepareLoad(Drawable placeHolderDrawable)
                        {

                        }
                    });