activity_main.xml

<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="focus event"
android:textSize="20dp"
android:background="#ff0"
android:gravity="center"
android:padding = "10dp"/>
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="put id"
android:padding="10dp"
android:background="@drawable/focus_selector"
android:textColorHint = "#ff0"
android:textSize="20dp"/>
<EditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="put password"
android:padding="10dp"
android:background="@drawable/focus_selector"
android:textColorHint = "#ff0"
android:textSize="20dp"/>

focus_selector.xml

//res\drawable

<item android:state_focused = "true"
android:drawable="@drawable/red"/>
<item android:drawable="@drawable/blue"/>

MainActivity.java

'android studio' 카테고리의 다른 글

방향전환 event로 activity 유지하기  (0) 2019.08.13
방향전환시 상태값 저장  (0) 2019.08.12
touch event, gesture event  (0) 2019.08.12
카드뷰(CardView)  (0) 2019.08.12
버튼 style변경(onDraw(), invalidate())  (0) 2019.08.12

+ Recent posts