使用 Android Studio 中的 登录活动(Login Activity) 模板,选择最低 SDK API 14 创建项目,然后在 styles.xml 中将 colorAccent
自定义为粉色:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">#FF4081</item><!-- pink color -->
</style>
LG Nexus 5X 可以生效(已在 Marshmallow 和 Nougat 上测试):![enter image description here](https://istack.dev59.com/ckDsO.webp)
![enter image description here](https://istack.dev59.com/UArja.webp)
请注意,
colorControlActivated
也存在同样的问题,不仅限于 colorAccent
。
[更新]
在Xiaomi Mi 3上测试,没有这样的问题。android:textCursorDrawable="@drawable/fb"
对于这三个设备具有相同的行为(即仅 Huawei P9 Lite 不起作用)。