0

我使用 InkScape 剪切图像。从这里我用draw9patch制作了一个.9 png图像。.9 现在位于我的 drawables-hdpi 文件夹中。我已将此图像作为 res/layout 文件中 EditText 的背景。图像显示,但它覆盖了来自 android:hint 的文本。

这是布局文件的代码---

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/Black"
android:orientation="vertical" >

<EditText
    android:id="@+id/etCommands"
    android:layout_width="fill_parent"
    android:layout_height="35dp"
    android:background="@drawable/silvertextbox"
    android:ems="10"
    android:gravity="center"
    android:hint="Type a Command"   //This text is covered by @drawable
    android:password="true" >

    <requestFocus />
</EditText>

就像我说的,我的问题是 android:hint 被 android:background 覆盖。如何确保 android:hint 的文本在背景@drawable 之上?

我会在下面发布一张图片来显示图形布局,但我显然没有 10 个声望点。我想知道我是否必须在代码方面做一些事情来使@drawable 透明/半透明。还是我必须先使用 Inkscape 使 @drawable 透明/半透明?感谢您提供的所有帮助。

4

1 回答 1

0

尝试为 设置一些填充textbox.it,应该可以解决问题。

于 2013-04-03T17:04:14.247 回答