我想做一個畫板,現在需要增加一個插入圖片的功能。目前我自定義了一個View來實現畫線等功能,然后在MainActivity里創建了它,所以我不知道該怎么添加imageview來放置圖片了,或者還有別的方法能實現?
2 回答

茅侃侃
TA貢獻1842條經驗 獲得超21個贊
``` LinearLayout ll= (LinearLayout) this.findViewById(R.id.actClient_LinearLayout);
ll.removeView(img_preview);
img_preview=new ImageView(this);
img_preview.setBackgroundResource(R.drawable.girl);
ll.addView(img_preview);
添加回答
舉報
0/150
提交
取消