我正在使用Picasso
向icon
添加actionbar
。我已经读过,为了在每次需要Target
strong reference
final
时加载图片而我已经使用了onPrepareLoad
。但是,它再次进入onBitmapLoaded
并且永远不会达到private void setLogoToActionBar() {
final Target target = new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
Log.d("DEBUG", "onBitmapLoaded");
Drawable d = new BitmapDrawable(getResources(), bitmap);
actionBar.setIcon(d);
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
Log.d("DEBUG", "onBitmapFailed");
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
Log.d("DEBUG", "onPrepareLoad");
actionBar.setIcon(placeHolderDrawable);
}
};
Picasso.with(getContext()).load(mShop.getClientLogo()).placeholder(R.drawable.shop_asset).resize(100, 100).into(target);
}
。
我做错了什么?
$(document).ready(function () {
// Hide the model or a div; whatever you are using
$(".modal").hide();
//listen for the submit button click
$("#myForm").submit(function (event) {
$(".modal").show();
// set a timeout to hide the gif
setTimeout(function () { $('.modal').hide(); }, 2500);
});
});