AndroidのEditView入力ボックスは、カーソルのデフォルトの色を変更します

序文

今日、我々はデフォルトカラーボックスのカーソルを変更するために入力を見てそう、実際の開発の変化があるでしょう、あなたの目でネイティブAndroidのコントロールカラー刺すことをすべて知っています。
cursor_style.xmlスタイルdrawbleで以下というファイルを作成します。

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <size android:width="1dp" />
    <solid android:color="#4A90E2" />
</shape>

次に、レイアウトファイルを使用することができます

			<EditText
                android:id="@+id/ed_pwd"
         		android:textCursorDrawable="@drawable/cursor_style"
                android:textColor="#000"
                android:textSize="@dimen/sp_24"
                android:paddingLeft="@dimen/dp_15"
                android:layout_width="wrap_content"
                android:layout_height="@dimen/dp_65"/>

そして、あなたは青いカーソルを見ることができます。

公開された33元の記事 ウォン称賛7 ビュー10000 +

おすすめ

転載: blog.csdn.net/qq_38436214/article/details/104778733