我有一行有两个EditText和两个ImageButton。在android studio的预览中,一切都很好,EditTexts有默认的样式。但是如果我在平板电脑上显示它的背景是黑色的。Android:EditText显示黑色背景
究竟应该如何样子:
它是如何看起来像在平板电脑上:
其他的EditText盒正确显示。 有谁知道为什么这些看起来不同,我该如何解决它?
下面这一行的XML-布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerHorizontal="true"
>
<EditText
android:id="@+id/first_input"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
/>
<EditText
android:id="@+id/second_input"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2.4"
/>
<ImageButton
android:id="@+id/first_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:src="@drawable/move"
android:background="@drawable/first_button_background"
android:onClick="onFirstButtonClicked"
/>
<ImageButton
android:id="@+id/second_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:src="@drawable/trash"
android:background="@drawable/second_button_background"
android:onClick="onSecondButtonClicked"
/>
</LinearLayout>
编辑: 我试图改变背景颜色为白色,但随后EditTexts失去他们的整体风格也是如此下划线将不再显示。
我想到了使用自定义主题,但我认为都必须有默认的样式,以显示他们的可能性因为其他EditTexts正确显示 – 2015-04-02 12:45:33
已尝试android:background =“#ffffff”?? – 2015-04-02 12:46:58
是的,我做到了。但然后EditTexts失去了他们的风格,像下划线.. – 2015-04-02 12:49:48