您可以參考this代碼。風景模式邊框圖像在edittext不起作用
編輯文本的邊框顏色設置爲某種顏色。 在portratait模式下正常工作。 爲什麼我在landsacpe模式下看不到相同的顏色/圖像?在橫向模式下,當軟鍵打開時,編輯文本顏色變爲紅色(默認)..我可以在哪裏找到紅色邊框可縮放圖像? ny的想法?
下面是我的佈局文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/edit1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/edit1_text"
android:inputType="text"
android:background="@drawable/edit_text"
/>
<EditText
android:id="@+id/edit2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/edit2_text"
android:inputType="text"
android:background="@drawable/edit_text"
/>
</LinearLayout>
,這裏是@繪製/ edit_text文件代碼
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_window_focused="false"
android:state_enabled="true"
android:drawable="@drawable/textfield_default" />
<item
android:state_window_focused="false"
android:state_enabled="false"
android:drawable="@drawable/textfield_disabled" />
<item
android:state_pressed="true"
android:drawable="@drawable/textfield_pressed" />
<item
android:state_enabled="true"
android:state_focused="true"
android:drawable="@drawable/textfield_selected" />
<item
android:state_enabled="true"
android:drawable="@drawable/textfield_default" />
<item
android:state_focused="true"
android:drawable="@drawable/textfield_disabled_selected" />
<item
android:drawable="@drawable/textfield_disabled" />
</selector>
張貼一些圖像並指出問題 – 2013-03-13 05:17:33
圖像存在@該鏈接..在風景模式邊框圖像不可見 – 2013-03-13 05:23:23
該鏈接中的圖像顯示帶邊框的橫向模式下的編輯文本。請在這裏發表您的代碼的圖片,有一些代碼你做了什麼 – 2013-03-13 05:37:10