小编Nar*_*a J的帖子

如何在TextInputLayout中设置EditText小部件的样式

刚开始造型和主题应用程序.

我有很多EditText以s TextInputLayoutS IN的AppCompatActivity.

在此输入图像描述

我的问题是:

  • 不确定EditText小部件中的线(上面的蓝线)是什么,只是将其称为"标尺".统治者(上面看不见)如何变得可见,以及任何自定义颜色.目前,统治者仅在点击时显示EditText.
  • EditText光标不显示,怎么能是可见的?
  • 如何根据背景颜色和文字颜色自定义上面的"添加"按钮?
  • 如何将焦点设置为EditText最初的第一个?
  • TextInputLayout在收缩并飞向顶部后,如何改变暗示颜色?(目前,蓝色.)
  • 是默认的Android字体Roboto吗?如何将字体更改为可用的任何内容,"真正快速"?

非常感谢任何帮助或指针.

对应的代码片段:

Layout 文件

            <TextView
            android:id="@+id/pocLabel"
            style="@style/DialogLabelColor"
            android:text="Business Owner"/>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/tilPOCFName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/pocLabel">

            <android.support.v7.widget.AppCompatEditText
                android:id="@+id/POCFName"
                style="@style/InputDialogText"
                android:hint="First name (REQUIRED)"
                android:inputType="textCapWords"/>
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/tilPOCLName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/tilPOCFName"
            android:textColor="#000000">

            <EditText
                android:id="@+id/POCLName"
                style="@style/InputDialogText"
                android:hint="Last name"
                android:inputType="textCapWords"/>
        </android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)

styles.xml

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on …
Run Code Online (Sandbox Code Playgroud)

user-interface android

0
推荐指数
1
解决办法
6912
查看次数

标签 统计

android ×1

user-interface ×1