Set background and alpha of EditText

Examples of Setting background and alpha of EditText:



xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:orientation="vertical"
tools:context="com.blogspot.android_er.androidedittextchanged.MainActivity">

android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@android:mipmap/sym_def_app_icon"/>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:autoLink="web"
android:text="http://android-er.blogspot.com/"
android:textStyle="bold"/>
android:id="@+id/edittext1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="28dp"
android:text="normal EditText"/>
android:id="@+id/edittext2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="EditText with background #50FFFFFF"
android:textSize="28dp"
android:background="#50FFFFFF"/>
android:id="@+id/edittext3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="EditText with background #FFFFFF"
android:textSize="28dp"
android:background="#FFFFFF"/>
android:id="@+id/edittext4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="EditText with background #FFFFFF and alpha=0.5"
android:textSize="28dp"
android:background="#FFFFFF"
android:alpha="0.5"/>





Popular posts from this blog

OnePlus Releases OxygenOS 4.5 OTA For OnePlus 3 and OnePlus 3T

Report: Incredibly Accurate GPS Chips are Coming to Smartphones Next Year

Black Friday saw the lowest price yet for the Roomba j7 from iRobot.