我正在此应用程序中实现益智游戏应用程序在单击按钮时创建一个按钮显示谜题的原始图像。原始图像显示在对话框中然后单击确定返回实际页面如何实现
bitmapOrg = BitmapFactory.decodeResource(getResources(),mThumbIds[GameActivity.level]);
请转发一些解决方案,这个问题很紧急,等待更多天提前谢谢
我正在此应用程序中实现益智游戏应用程序在单击按钮时创建一个按钮显示谜题的原始图像。原始图像显示在对话框中然后单击确定返回实际页面如何实现
bitmapOrg = BitmapFactory.decodeResource(getResources(),mThumbIds[GameActivity.level]);
请转发一些解决方案,这个问题很紧急,等待更多天提前谢谢
我认为您需要在对话框中设置一个图标。
如果是这样,您可以通过以下方式进行
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Message");
builder.setCancelable(false)
.setPositiveButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
AlertDialog alert = builder.create();
alert.setTitle("Title");
alert.setIcon(R.drawable.your_image);
alert.show();
谢谢
如果要在对话框中设置图像,这是一个粗略的答案:
ImageView 图像=新 ImageVIew(this);
image.setLayoutParams(new LayoutParams(你的宽度,高度));
通过使用可绘制或设置位图在此图像视图上设置背景图像
新的 AlertDialog().Builder(this).setView(image).show();
这只是一个粗略的解决方案,但它会给你一个想法