나는 edittext가있는 간단한 레이아웃을 가지고 있습니다. 나는 색상EditText 문제의 배경색 변경
<EditText
android:id="@+id/et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@android:color/white" />
글고 향상에 포커스 때 그런 이상한 일이 발생, 레이아웃 변경의 배경 색상에 EditText
의 배경을 설정
(!).
는 동적으로 배경색을 변경해야하고, 나는 호출 한 후 같은 결과를 가지고
subject.setBackgroundColor(Color.parseColor(mycolor));
나는 또한 다음과 같은 방법을 시도했다 :
subject.setBackground(new ColorDrawable(Color.parseColor(mycolor)));
결과는 동일했다.
기본적으로 런타임에 Edittext의 배경색을 변경하고 싶습니다.
사용 선택기 ... http://stackoverflow.com/questions/14542557/android-different-edittext-backgrounds-for-different-states-using-shapes-select – ASP
http://stackoverflow.com/questions/11275779/edittext-drawable-background-for-each-state – ASP
@ASP 원격 서버에서 색상을 얻으므로 색상을 동적으로 변경하고 싶습니다. – user1940676