我想知道如果我可以刪除我的ImageView的背景後,我選擇一個圖像 例子.. 的ImageView的有寫在上面插入圖像 背景照片,當我從畫廊或相機選擇圖像 和它通過「choosenBitmap」 插入到imageview中,但imageview背景仍然存在,並且我想將其刪除Android選擇後刪除背景嗎?
我嘗試「imageView.remove(background);」 和「remove.background」 但沒有結果
我想知道如果我可以刪除我的ImageView的背景後,我選擇一個圖像 例子.. 的ImageView的有寫在上面插入圖像 背景照片,當我從畫廊或相機選擇圖像 和它通過「choosenBitmap」 插入到imageview中,但imageview背景仍然存在,並且我想將其刪除Android選擇後刪除背景嗎?
我嘗試「imageView.remove(background);」 和「remove.background」 但沒有結果
使用以下的一個:
// API 15 or lower
imageView.setBackgroundDrawable(null);
// API 16 or higher
imageView.setBackground(null);
// Any APIs
imageView.setBackgroundResource(0);
imageView.setBackgroundColor(0);
一種或另一種可能工作與否取決於您的實現。
imageView.setBackground(null);
這就是爲我工作的。
第三個人工作,謝謝=) – 2012-07-26 23:25:43
不要忘記點擊答案旁邊的小複選標記,如果它幫助你...它會幫助其他人找到答案,並幫助你在未來獲得更好的答案! :) – Eric 2012-07-26 23:34:19
哦,對不起,我是新的..點擊:D – 2012-07-27 01:39:35