久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

包裝到 TextInputLayout 時更改 EditText 底線的粗細

Change thickness of the bottom line of EditText when wrapped into TextInputLayout(包裝到 TextInputLayout 時更改 EditText 底線的粗細)
本文介紹了包裝到 TextInputLayout 時更改 EditText 底線的粗細的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

這是我的代碼

XML 標記

(聚焦視圖)

現在我的問題/問題

  1. 我希望底線更薄.我應該在哪里改變它.
  2. 閃爍的光標不顯示,如何顯示.
  3. EditText 會自動突出顯示拼寫錯誤.我需要阻止它.

誰能指出解決問題的正確方法.評論你任何人都需要更多信息來回答這個問題.

提前致謝.

解決方案

我已經使用我的自定義 xml drawable 解決了我的問題.可能有更好的方法,但我找不到.以下是我用作文本框背景的可繪制對象

<?xml version="1.0" encoding="utf-8"?><選擇器xmlns:android="http://schemas.android.com/apk/res/android"><項目 android:state_pressed="true"><層列表><項目機器人:底部=1dp"機器人:左=-2dp"機器人:右=-2dp"android:top="-2dp"><形狀 android:shape="矩形"><中風安卓:寬度=0.5dp"android:color="@color/primaryColor"/><solid android:color="#00FFFFFF"/><填充 android:left="3dp"機器人:右=3dp"機器人:頂部=3dp"android:bottom="3dp"/></形狀></項目></層列表></項目><項目 android:state_focused="true"><層列表><項目機器人:底部=1dp"機器人:左=-2dp"機器人:右=-2dp"android:top="-2dp"><形狀 android:shape="矩形"><中風安卓:寬度=0.5dp"android:color="@color/primaryColor"/><solid android:color="#00FFFFFF"/><填充 android:left="3dp"機器人:右=3dp"機器人:頂部=3dp"android:bottom="3dp"/></形狀></項目></層列表></項目><項目><層列表><項目機器人:底部=1dp"機器人:左=-2dp"機器人:右=-2dp"android:top="-2dp"><形狀 android:shape="矩形"><中風安卓:寬度=0.5dp"android:color="#BCBCBC"/><solid android:color="#00FFFFFF"/><填充 android:left="3dp"機器人:右=3dp"機器人:頂部=3dp"android:bottom="3dp"/></形狀></項目></層列表></項目></選擇器>

here is my code

XML Markup

<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/TextLabel">

    <EditText
        android:id="@+id/etContactName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Contact Name"/>

</android.support.design.widget.TextInputLayout>

Style

<style name="TextLabel" parent="TextAppearance.AppCompat">
    <item name="android:textColorHint">@color/hintColor</item>
    <item name="colorAccent">@color/primaryColor</item>
    <item name="colorControlNormal">@color/hintColor</item>
    <item name="colorControlActivated">@color/primaryColor</item>
</style>

Here is the output
(normal view)

(focused view)

Now My Problems / Issues

  1. I want the bottom line to be thinner. where should I change it.
  2. The blinking cursor is not showing, how to show it.
  3. EditText is automatically highlighting the spelling mistakes. I need to stop it.

Can anyone please point me to the right way to resolve the issues. Comment you anyone needs more info to answer this.

Thanks in advance.

解決方案

I've solved my issue using my custom xml drawable. There might be some better way, but I couldn't find any. following is my drawable that I'm using as background of my textbox

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <layer-list >
            <item
                android:bottom="1dp"
                android:left="-2dp"
                android:right="-2dp"
                android:top="-2dp">
                <shape android:shape="rectangle" >
                    <stroke
                        android:width="0.5dp"
                        android:color="@color/primaryColor" />

                    <solid android:color="#00FFFFFF" />

                    <padding android:left="3dp"
                        android:right="3dp"
                        android:top="3dp"
                        android:bottom="3dp" />
                </shape>
            </item>

        </layer-list>
    </item>
    <item android:state_focused="true">
        <layer-list >
            <item
                android:bottom="1dp"
                android:left="-2dp"
                android:right="-2dp"
                android:top="-2dp">
                <shape android:shape="rectangle" >
                    <stroke
                        android:width="0.5dp"
                        android:color="@color/primaryColor" />

                    <solid android:color="#00FFFFFF" />

                    <padding android:left="3dp"
                        android:right="3dp"
                        android:top="3dp"
                        android:bottom="3dp" />
                </shape>
            </item>

        </layer-list>
    </item>
    <item>
        <layer-list >
            <item
                android:bottom="1dp"
                android:left="-2dp"
                android:right="-2dp"
                android:top="-2dp">
                <shape android:shape="rectangle" >
                    <stroke
                        android:width="0.5dp"
                        android:color="#BCBCBC" />

                    <solid android:color="#00FFFFFF" />

                    <padding android:left="3dp"
                        android:right="3dp"
                        android:top="3dp"
                        android:bottom="3dp" />
                </shape>
            </item>

        </layer-list>
    </item>

</selector>

這篇關于包裝到 TextInputLayout 時更改 EditText 底線的粗細的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event(EditText:禁用文本選擇處理程序單擊事件上的粘貼/替換菜單彈出)
Multiline EditText with Done SoftInput Action Label on 2.3(2.3 上帶有完成 SoftInput 操作標簽的多行 EditText)
How to detect the swipe left or Right in Android?(如何在 Android 中檢測向左或向右滑動?)
Prevent dialog dismissal on screen rotation in Android(防止在Android中的屏幕旋轉對話框解除)
How do I handle ImeOptions#39; done button click?(如何處理 ImeOptions 的完成按鈕點擊?)
How do you set EditText to only accept numeric values in Android?(您如何將 EditText 設置為僅接受 Android 中的數值?)
主站蜘蛛池模板: 国产美女永久免费无遮挡 | 亚洲精品在线观 | 国产一区二区a | 国产精品一区二区三区久久久 | 超碰最新在线 | 久草网免费 | 手机三级电影 | 中国一级毛片免费 | h视频在线观看免费 | 亚洲午夜视频在线观看 | 免费一看一级毛片 | 久久亚洲国产精品 | 日日骚网 | 四虎影视免费在线 | 国产欧美精品一区二区三区 | www视频在线观看 | 精品亚洲一区二区 | 欧美1区2区| 久久国内 | 日本精品一区二区 | 国产99久久精品一区二区永久免费 | 免费色网址 | 欧美福利视频一区 | 在线视频国产一区 | 日本一本视频 | 欧美11一13sex性hd | 欧美日韩在线观看视频网站 | 久久精品99久久 | 精品1区2区 | 欧美涩 | 日韩精品视频在线观看一区二区三区 | 久久99精品久久久久久噜噜 | 国产精品呻吟久久av凹凸 | 天天干天天玩天天操 | 91精品中文字幕一区二区三区 | 国产在线精品一区 | 国内精品视频在线观看 | 91视频观看 | 欧美8一10sex性hd | 国产91在线 | 中日 | 国产电影一区 |