How to Enable Fading Edge in Text View in Android XML

How to Make text view Fade in Android Java Xml

Fading edge can make your textview appear faded in the beginning or end of that TextView in android.

You can use this xml code to enable fading edge for text view, it can give your app a more professional appearance

 

Xml code to give fading effect for text view

android:requiresFadingEdge="horizontal"
android:fadingEdgeLength="30dp"

 

Fading Edge Example

<TextView
       android:id="@+id/title"
       android:textSize="20sp"
       android:requiresFadingEdge="horizontal"
       android:fadingEdgeLength="30dp"
       android:paddingStart="5dp"
       android:singleLine="true"
       android:paddingRight="2dp"
       android:paddingEnd="2dp"
       android:paddingLeft="5dp"
       android:paddingBottom="2dp"
       android:layout_width="match_parent"
       android:layout_height="wrap_content" />

 

Result

Related Posts

Fix Plugin [id: ‘com.android.application’, version: ‘7.1.3’, apply: false] was not found in any of the following sources

Here is how to fix Plugin [id: ‘com.android.application’, version: ‘7.1.3’, apply: false] was not found in any of the following sources This error is caused by mismatching…

Get Age from Date of Birth in Java Android

Here is how to get a user’s age from date of birth If you need get a user’s age from a given date of birth string, this…

How to Check if String Array Contains a Specific String in Android

Here is how to get a specific value or String from Array in Android To check if a string array contains a specific string, you can use…

Make Android WebView Support Razorpay Payment

How to Support Razorpay Payment and UPI in Android WebView? Android webview is inexpensive and easy way to make apps for websites. But to support some specific…

Make Android Webview Support PayTM Google Pay PhonePe UPI

GooglePay, Phonpe and PayTM support in Android WebView If you have built an android app for your new ecommerce website or any other website that needs accept…

Comment