我在 alertdialog 中使用 ImageView 来显示图片。图像已在alertdialog中成功加载。我想添加缩放图像的附加功能。 我试过但没有结果。
我的警报对话框代码如下
private void loadPhoto(String url) {
AlertDialog.Builder imageDialog = new AlertDialog.Builder(context);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.custom_dialog_image, null);
ImageView image = (ImageView) layout.findViewById(R.id.fullimage);
Picasso.with(context)
.load(url)//load images into imageview
.placeholder(R.drawable.image_file)
.into(image);
imageDialog.setView(layout);
imageDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
imageDialog.create();
imageDialog.show();
}