如果要查看資源,我有資源png of a house已鏈接。它基本上只是一個黑暗的主頁按鈕。 我已將它包含並作爲圖像資源導入爲可繪製。 我試圖將其設置爲按鈕,但通過編程將其更改爲白色。 下面是我試圖改變顏色爲白色: ImageButton txtbtnAccept = new ImageButton(this);
this._surveyHomeButton = txtbtnAcce
if (image.getDrawable().getConstantState().equals(getResources().getDrawable(0).getConstantState())){
image.setVisibility(View.GONE);
}else{
image.setVisibility(View.VISIBLE);