LoginSignup
0
0

More than 1 year has passed since last update.

AndroidのEditTextのつまみ部分の色をする方法

Last updated at Posted at 2022-06-16

概要

AndroidのEditTextのつまみ部分の色を変更したいときがあった。
変更が反映されず少し手こずったので忘備録としてやり方を記載する。

EditTextのつまみ部分の色をする方法

styleでcolorControlActivatedに変更したい色を定義する。

styles.xml
<style name="CustomTextSelectionHandle">
    <item name="android:colorControlActivated">@color/newYellow</item>
</style>

レイアウトのTextViweのthemeにstyleを反映させるとつまみの色が変化する。
style="@style/CustomTextSelectionHandle"としてもつまみ部分の色は変更されず、themeでないと反映されなかった

layout.xml
<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TextView"
    app:theme="@style/CustomTextSelectionHandle" />
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0