Sunday 23 November 2014

Change color of Cursor (Titanium)

1. Create mytheme.xml ( platform/android/res/values/mytheme.xml )
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<style name="Theme.CursorColor" parent="@style/Theme.AppCompat.Translucent.NoTitleBar">
<item name="android:editTextStyle">@style/editText</item>
</style>
<style name="editText" parent="@android:style/Widget.EditText">
<item name="android:textCursorDrawable">@null</item>
<item name="android:textColor">#000000</item>
</style>
</resources>
2. Modify Tiapp.xml
<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <application android:theme="@style/Theme.CursorColor"/>
            <!-- Need to specify at least API level 11 for Titanium SDK 3.2.x and prior -->
            <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19"/>
        </manifest>
</android>

No comments:

Post a Comment