怎么弹出一个提示框显示图片? 本帖最后由 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的话,直接用就可以了,没有要想法把资源的格式转换成能够识别的 调用系统视频播放器,怎样让他固定竖着播放,不横屏 高手进 textview一行最后一个字隐掉一半 Canvas与Bitmap求解 android 蓝牙createBound函数 Virtue Device 为嘛我无法将ImageView中的Bitmap输出? 安卓开发入门该如何学习 gridview 滑动时checkbox 监听自动运行,跪求大神解答 求救,我的android studio为什么出这种错,求求大神如何解决? 控件的位置移动和保存问题 有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>