![](/img/trans.png)
[英]Android TextInputLayout and TextInputEditText cursor color problem
[英]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.