如何更改默认的风格的EditText如何更改、风格、EditText

2023-09-12 06:19:21 作者:㈠伎熏煙

我在我的XML文件中使用code这样创建3的EditText。

I am creating an three EditText in my xml file using code like this.

<EditText
            android:id="@+id/name_edit_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/profile_image_view_layout"
            android:layout_centerHorizontal="true"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="20dp"
            android:ems="15"
            android:hint="@string/name_field"
            android:inputType="text" />

当我运行它看起来像这样的应用在我的设备。

When i run the app it looks like this in my device.

但我想给喜欢看,而无需使用任何背景图片。

But i want to give a look like without using any background image.

那么,如何可以做?任何意见或建议将是有益的。

So how that can be done? Any idea or suggestion will be helpful.

推荐答案

您有几个选项。

使用 Android的资产工作室 Android的全息颜色生成器生成你需要添加到您的应用程序资源,风格和主题,以获得全息的外观在所有设备

Use Android assets studios Android Holo colors generator to generate the resources, styles and themes you need to add to your app to get the holo look across all devices.

使用全息到处库。

使用的PNG的全息文本字段并将其设置为背景图片自己。您可以从Android的资产工作室的全息图像的色彩产生。你必须做绘制并定义了正常,选中并禁用状态。

Use the PNG for the holo text fields and set them as background images yourself. You can get the images from the Android assets studios holo color generator. You'll have to make a drawable and define the normal, selected and disabled states.