2016-06-21 29 views
1

變化的EditText阿爾法我想這樣的結果:不影響繪製和文字透明度

enter image description here

,但即時通訊有這樣的:使用此代碼

enter image description here

我':

 <EditText 
      android:id="@+id/autoCompleteTextView1" 
      android:inputType="textAutoComplete|textAutoCorrect" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="center" 
      android:ems="10" 
      android:gravity="center" 
      android:hint="Destination *" 
      android:textColor="#ffffff" 
      android:textColorHint="#FFFFFF" 
      android:textSize="20sp" 
      android:background="#4d98d1" 
      android:alpha="0.2" 
      android:drawableLeft="@drawable/d" 
      android:adjustViewBounds="true" 
      android:scaleType="fitXY" 
      android:paddingLeft="30sp" 
      android:paddingRight="26dip" 
      android:focusable="false"/> 

有沒有呃改變,我可以在這裏適用?或者如果我可以以編程方式做到這一點?

回答

1

將背景定義爲ARGB顏色(使用透明alpha值)可能會起作用。

例如,變化:

android:background="#4d98d1" 

到:關於阿爾法十六進制值

android:background="#804d98d1" 

退房this answer獲得更多信息。

+0

太好了!謝謝 –