Set cursor drawable programmatically in android This below method is use for change cursor drawable programmatically in android. Pass two parameter as argument. 1) Object of EditText. 2) Cursor color. private void setCursorDrawableColor(EditText editText, int color) { try { Field fCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes"); fCursorDrawableRes.setAccessible(true); int mCursorDrawableRes = fCursorDrawableRes.getInt(editText); Field fEditor = TextView.class.getDeclaredField("mEditor"); fEditor.setAccessible(true); Object editor = fEditor.get(editText); ...
Create custom toast message in android Download Code Hello friends, Maybe you would like to create custom toast message. In the following image you can see how our custom toast message will look like. If you wont to create custom toast message like this, kindly download demo and use this code. I hope this code will help you… Thanks! Download Code
How to Apply Shadow Effect for Text in Android Hello friends, This example explains how to apply Shadow Effect on Android TextView. You can apply Shadow Effect on Android TextView in two ways. Either we do it pragmatically or we can change in the xml layout. <LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:layout_width = "fill_parent" android:layout_height = "fill_parent" android:orientation = "vertical" android:padding = "20dp" > <TextView android:id = "@+id/textview" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_gravity = "center_horizontal" android:shadowColor = "#000" android:shadowDx = "0" android:shadowDy = "0" android:shadowRadius = "50" ...
It's working...
ReplyDelete