Search code examples
androidtextviewandroid-custom-view

Android custom textview


I need textview where first letter is big capatalized like on the photo. What is the best library or solution to achieve that?

enter image description here


Solution

  • 1. Add following dependency in app/build.gradle

    compile 'com.github.rpradal.lettrine:lettrine:release_number'
    

    2. Use LettrineTextView

    <com.github.rpradal.lettrine.LettrineTextView
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  app:lettrine_textColor="@android:color/holo_red_dark"
                  app:lettrine_text="Lorem ipsum"
                  app:lettrine_lettrineSize="3"
                  app:lettrine_textSize="14sp" />
    

    For more help, please follow this link

    Result will be as:

    enter image description here