TagView icon indicating copy to clipboard operation
TagView copied to clipboard

How can we show the text in two lines?

Open sustun opened this issue 6 years ago • 4 comments

Hello there; I want to show a text consisting of two lines within a label. \ n or html text does not work. Best regards.

sustun avatar Sep 27 '17 20:09 sustun

That's because there is a tag setted for singleLine... If you want a quick solution, make a copy of this layout on this project and delete that propperty.

https://github.com/Cutta/TagView/blob/0043b7d68bc4ced477928125c6a5379c9c2db381/library/src/main/res/layout/tagview_item.xml

ldimitroff avatar Sep 27 '17 20:09 ldimitroff

I did not understand what you said. I'm using Android Studio and Gradle.

sustun avatar Sep 27 '17 20:09 sustun

In Android Studio, create a new layout resource file. name it "tagview_item.xml"

Inside paste this code as it is:

` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" >

<TextView
    android:id="@+id/tv_tag_item_contain"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center" />

<TextView
    android:id="@+id/tv_tag_item_delete"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:gravity="center"
    android:visibility="gone"/>

</LinearLayout>`

ldimitroff avatar Sep 27 '17 20:09 ldimitroff

Above solution works only if you add the library manually in your project instead of Gradle.

DivyaPrajapati09 avatar Oct 01 '19 09:10 DivyaPrajapati09