请高手指点如何在activity里插入图片。谢谢! 布局文件中添加一个ImageView和一个TextView就可以了啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 getLoacalBitmap() 在问一下 这个方法后面的参数是什么样的格式,我输入了很多次都不对,我对图片命得名是aua,在桌面上存的,这是我写的Bitmap bitmap = getLoacalBitmap("\aua\aua.jpg");但是eclipse报错。这是怎么回事啊 用LinearLayout将一个imageview和一个textview放在一起。 getLoacalBitmap()哪个类的方法 ctrl + shift + O 自动import缺的库 找本android的书,保证在前5章之内找到答案 private ImageView myImageView; myImageView = (ImageView)findViewById(R.id.bitmapImageView02); Resources res = getResources(); // 通过Resources获得Drawable实例 Drawable draw = res.getDrawable(R.drawable.g1); // 设置ImageView的ImageDrawable属性显示图片 myImageView.setImageDrawable(draw);jpg图片存放在项目中"res/drawable/"目录下。上面代码中的图片名就是g1.jpg 这几句,你可以试试,没有问题。我是这么实现的 private Paint back=null; private Bitmap ground; back=new Paint(); Resources r=this.getContext().getResources(); ground=((BitmapDrawable)r.getDrawable(R.drawable.back)).getBitmap(); 如何在WebView中通过Java传递给JS数组 android NDK jni下的c文件 Unresolved inclusion 求解 怎么修改程序名?现在有一个工程, ✿✿✿一个关于直接回复短信的问题 android 怎么挂再mtd分区, USB驱动问题 安卓布局问题 Unbuntu下升级JDK后显示版本号不同 android程序可以开发直接打内线号码吗? 无法下载Android SDK Components? 两份froyo的代码,为什么在froyo_A代码中的打印会在froyo_B 中打印出来
private ImageView myImageView;
myImageView = (ImageView)findViewById(R.id.bitmapImageView02);
Resources res = getResources();
// 通过Resources获得Drawable实例
Drawable draw = res.getDrawable(R.drawable.g1);
// 设置ImageView的ImageDrawable属性显示图片
myImageView.setImageDrawable(draw);
jpg图片存放在项目中"res/drawable/"目录下。上面代码中的图片名就是g1.jpg
private Paint back=null;
private Bitmap ground;
back=new Paint();
Resources r=this.getContext().getResources();
ground=((BitmapDrawable)r.getDrawable(R.drawable.back)).getBitmap();