LayoutInflater inflater=LayoutInflater.from(context);
View view=inflater.inflate(R.layout.main, null);
TextView tv=(TextView)view.findViewById(R.id.mytextview);
tv.setText("gggggggggggg");
tv.setTextColor(Color.BLACK);Bitmap tmpBmp = Bitmap.createBitmap(400,600,Bitmap.Config.ARGB_8888);
Canvas mCanvas = new Canvas(tmpBmp);
view.draw(mCanvas);
canvas.drawBitmap(tmpBmp,0, 0, null);
可是画出来的是布局,里面的textview和别的控件都没有显示,怎么回事
View view=inflater.inflate(R.layout.main, null);
TextView tv=(TextView)view.findViewById(R.id.mytextview);
tv.setText("gggggggggggg");
tv.setTextColor(Color.BLACK);Bitmap tmpBmp = Bitmap.createBitmap(400,600,Bitmap.Config.ARGB_8888);
Canvas mCanvas = new Canvas(tmpBmp);
view.draw(mCanvas);
canvas.drawBitmap(tmpBmp,0, 0, null);
可是画出来的是布局,里面的textview和别的控件都没有显示,怎么回事
解决方案 »
- 新手,正在装安卓开发工具求解!
- 循环遍历文件夹
- 监听短信接收后,如何在我ListView里面更新新进来的短信内容?
- 求一andriod入门书籍
- 急急急急急急...抽屉 SlidingDrawer handle事件
- 想用U3D做一个手机软件,软件可以查看新闻,可以回复,可以查看图片,预计用户10万人,请问用webservice还是json还是socket进行数据传递呢?
- monkeyrunner不能同时操作两个设备的疑问
- Android帮忙实现个小的功能
- 关于动态获取一个布局高度的疑问
- android ijkplayer播放不了raw、assets里的视频文件
- 按home键之后返回应用的问题
- pin码,输入3次之后,没有输入PUK码框界面
// TODO Auto-generated method stub
super.onDraw(canvas);
/* Matrix mx=new Matrix();
//mx.postRotate(arc, 5, 30);
mx.postRotate(arc);
Bitmap bitmap=BitmapFactory.decodeResource(getResources(), R.drawable.a);
Bitmap bip=Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), mx, true);
canvas.drawBitmap(bip,0, 0, null);
arc++;*/
LayoutInflater inflater=LayoutInflater.from(context);
View view=inflater.inflate(R.layout.main, null);
TextView tv=(TextView)view.findViewById(R.id.mytextview);
tv.setText("gggggggggggg");
tv.setTextColor(Color.BLACK);
Bitmap tmpBmp = Bitmap.createBitmap(400,600,Bitmap.Config.ARGB_8888);
Canvas mCanvas = new Canvas(tmpBmp);
view.draw(mCanvas);
canvas.drawBitmap(tmpBmp,0, 0, null);
}