我想在每个EditText中放一条小线

时间:2013-01-17 11:19:40

标签: android

我想在编辑文本下添加小行,如下所示,我该怎么做?

enter image description here

1 个答案:

答案 0 :(得分:2)

默认情况下,这是Holo Theme中的Edittext。所以只需申请Holo Theme。

如果您想申请Holo Theme。设置

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17" />
values-v11 文件夹中的

styles.XML

<resources>

<!--
    Base application theme for API 11+. This theme completely replaces
    AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
    <!-- API 11 theme customizations can go here. -->
</style>

文件夹

中的

styles.XML

<resources>

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light.NoTitleBar">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>


 <style name="progressbar_holo" parent="@android:style/Theme.Light">
</style>

并在 AndroidMeanifeast.xml

android:theme="@style/AppTheme"

应用程序 TAG。