簡體   English   中英

如何在 textinputlayout 內的 textinputedittext 中更改 cursor 顏色

[英]How to change the cursor color in textinputedittext inside textinputlayout

在此處輸入圖像描述

如何更改 textinputedittext 的 cursor 顏色。

我使用了 textcursordrawable 但它不起作用。 提前致謝

如果只想更改 cursor 顏色,可以使用:

<com.google.android.material.textfield.TextInputLayout                
    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
    android:theme="@style/ThemeOverlay.AppTheme.TextInputEditText.Outlined"
    ....>

和:

<style name="ThemeOverlay.AppTheme.TextInputEditText.Outlined" parent="">
    <item name="colorControlActivated">@color/...</item>
</style>

在此處輸入圖像描述

如果要更改 cursor 顏色還要盒子,label..

<style name="ThemeOverlay.AppTheme.TextInputEditText.Outlined" parent="">
    <item name="colorPrimary">@color/...</item>
</style>

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM