久久久久久久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 中的數值?)
主站蜘蛛池模板: 九九精品久久久 | 国产精品视频网站 | 亚洲精品1| 国产福利在线播放麻豆 | 一区中文字幕 | 国产成人精品一区二区三区网站观看 | 免费在线观看黄网站 | 久草在线 | 日韩精品一区二区三区视频播放 | 成人片网址 | 成人av看片 | 亚洲国产高清高潮精品美女 | 高清一区二区三区 | 国产特级毛片 | 亚洲三级在线 | 欧美区在线观看 | 亚洲精品乱码久久久久久久久久 | 精品国产乱码久久久久久蜜柚 | 欧美美女爱爱视频 | 精品国模一区二区三区欧美 | 久久人人网 | 91精品国产欧美一区二区成人 | 色婷婷久久久久swag精品 | 激情五月综合 | 国产精品无码专区在线观看 | 男插女下体视频 | 毛片在线免费 | 亚洲成人一区二区 | 亚洲国产中文字幕 | 欧美一区二区免费电影 | 日韩久久精品 | 精品久久久久久亚洲综合网站 | 91精品久久久 | 黄色片视频免费 | 亚洲精品乱码 | 欧美在线国产精品 | 欧美亚洲视频 | www.伊人.com| 欧美激情久久久 | 成人精品在线观看 | 拍戏被cao翻了h承欢 |