Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Reuse style xml for EditText introduce bug for cursor #739

Open
paul1992li opened this issue Apr 12, 2019 · 1 comment
Open

Reuse style xml for EditText introduce bug for cursor #739

paul1992li opened this issue Apr 12, 2019 · 1 comment

Comments

@paul1992li
Copy link

I use anko layout like editText(R.style.InputStyle) and set android:padding and android:background in this style. unfortunately cursor and selectHandle like pic:


企业微信截图_a5d75bf5-1e76-48c1-9953-5e3a726326e1

@ageevvalentin
Copy link

ageevvalentin commented Apr 12, 2019

I added example to wiki (https://github.com/Kotlin/anko/wiki/Anko-Layouts-Examples#styles). Example:

<style name="App.ThemeOverlay.CustomEditText" parent="ThemeOverlay.{MaterialComponents or AppCompat}">
        <item name="android:editTextStyle">@style/App.Widget.CustomEditText</item>
</style>

<style name="App.Widget.CustomEditText" parent="Widget.AppCompat.EditText">
        <item name="android:background">Your background</item>
        <!--Other style items...-->
</style>

Using:

themedEditText(R.style.App_ThemeOverlay_CustomEditText)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants