我嘗試了幾件事情,並沒有什麼工作...我試圖改變BACKGROUNDCOLOR Android上的一個ImageView的,但沒有任何反應......如何在Android上的ImageView上設置BackgroundColor?
這裏是我的xml:
<ImageView
android:id="@+id/imageView1"
android:layout_width="350dp"
android:layout_height="550dp"
android:layout_above="@+id/btnInfo"
android:layout_alignLeft="@+id/fundo"
android:layout_alignRight="@+id/btnInfo"
android:layout_alignTop="@+id/fundo"
android:layout_centerHorizontal="true"
android:contentDescription="@string/backgroundMain" />
和代碼:
public void onStart()
{
super.onStart();
Log.d("Teste", "In the onStart() event 5");
ImageView backgroundImg = (ImageView) findViewById(R.id.imageView1);
backgroundImg.setBackgroundColor(Color.rgb(255, 255, 255));
}
我錯過了什麼?
也許如果我設置了不同的顏色,而不是白色,我可以看到它......¬¬¬,我的代碼正在工作......感謝誰讀那個;) – CarinaPilar
我要指出,但我認爲不可能! –