5
アクションバーのSearchView(私はアクションバーSherlockを使用しています)の点滅カーソルの色を互換性のために変更します。今まで私はEditText要素のカーソルの色を変更することができました。 This SO postはそれを達成するために私を助け、私はのEditTextのために使用しているスタイルは次のようになります。SearchViewのカスタムカーソルの色
<style name="CustomTheme" parent="Theme.Sherlock.Light">
<item name="android:editTextStyle">@style/edittext_style</item>
</style>
<style name="edittext_style" parent="@android:style/Widget.EditText">
<item name="android:textCursorDrawable">@drawable/red_cursor</item>
</style>
赤いカーソルが次のようになります。私はの実装を見てみました
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient android:startColor="@color/darkRed"
android:endColor="@color/darkRed" />
<size android:width="1dp" />
</shape>
SearchViewウィジェットを使用していますが、テキスト入力には
AutoCompleteTextViewが使用されています。 AutoCompleteTextViewはEditTextウィジェットから派生したものなので、スタイルがEditTextでは機能しているが、AutoCompleteTextViewでは(そしてSearchViewでは)なぜ機能していないのか分かりません。
誰かがSearchViewウィジェットのカーソルの色を変更できましたか?
:SearchAutoCompleteTextViewのテーマにtextCursorDrawableをし、それはうまくいくはずだった。 – MaTriXy
うん、それは私がやったことだ。ありがとう – mvieghofer
デフォルトの色を変更することはできますが、ドロアブルは変更できませんか?私はcolorControlActivatedを使用しましたが、これは単なるテキストキャレットの色よりも変わります... –