怎么弹出一个提示框显示图片? 本帖最后由 chijiunan 于 2011-07-23 23:13:46 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 问题一:LayoutInflater inflater = activity.getLayoutInflater(); View layout = inflater.inflate(R.layout.weatherset, (ViewGroup)activity.findViewById(R.id.weatherset)); new AlertDialog.Builder(activity).setTitle("自定义布局").setView(layout) .setPositiveButton("确定", null) .setNegativeButton("取消", null).show(); Toast.makeText(activity, "ok", Toast.LENGTH_LONG).show();weatherset.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/weatherset"> //这里放你的图片 </LinearLayout> 首先图片可以看做资源,如果获取资源有API的话,直接用就可以了,没有要想法把资源的格式转换成能够识别的 ViewPager加载activity内容不显示 本人的android模拟器出了点问题 求教 java 正则表达式 新人求助 导入整个android工程 单个文件没有报错,整个工程报错 Your project contains error(s) eclipse如何查看哪里出错? 如何使用libffmpeg.so? 求助! android 广播接收者 正则表达式匹配问题 android 时间widget更新 UTF-8编码的程序输入中文问题 控件的位置移动和保存问题 有Intent为什么还要用Bundle呢?
LayoutInflater inflater = activity.getLayoutInflater();
View layout = inflater.inflate(R.layout.weatherset,
(ViewGroup)activity.findViewById(R.id.weatherset)); new AlertDialog.Builder(activity).setTitle("自定义布局").setView(layout)
.setPositiveButton("确定", null)
.setNegativeButton("取消", null).show();
Toast.makeText(activity, "ok", Toast.LENGTH_LONG).show();
weatherset.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/weatherset">
//这里放你的图片
</LinearLayout>