首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何将图片放入AlertDialog?安卓

如何将图片放入AlertDialog?安卓
EN

Stack Overflow用户
提问于 2011-06-08 17:07:01
回答 3查看 92.2K关注 0票数 32

我不知道如何将图像放入AlertDialog中。

我有这个代码,但我认为这是不可能的。

AlertDialog.Builder alert = new AlertDialog.Builder(MessageDemo.this);    
ImageView imageView = (ImageView) findViewById(R.id.imageView1);    
imageView.setImageResource(R.drawable.cw);             
alert.setView(imageView);    
alert.setNeutralButton("Here!", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dlg, int sumthin) {

    }
});    
alert.show();
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6276501

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档