2
我有以下layout.xml
:的Android ImageView的 - 如何不使imageview的有色
<LinearLayout
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/image"
android:layout_width="100dp"
android:layout_height="50dp"
android:src="@drawable/logo"/>
...
</LinearLayout>
我設置父LinearLayout
像這樣的背景顏色:
LinearLayout layout = (LinearLayout) view.findViewById(R.id.layout);
layout.setBackgroundColor(Color.parseColor("#727272"));
layout.setAlpha(0.5f);
然而,ImageView
(ID :圖像)被着色。有沒有辦法在設置其父級佈局的背景顏色時不要着色ImageView
?
什麼是eventLogoLayout? –
你爲什麼設置eventLogoLayout.setAlpha(0.5f)?它有色也許取決於你的標誌。你必須在這裏附上你的屏幕。 – ikhsan
設置ImageView background = null。可能是它的幫助 – Konstantin