ExpandableTextView
ExpandableTextView copied to clipboard
Write the widget in xml ,but show nothing in screen.Anything wrong?
<com.ms.square.android.expandabletextview.ExpandableTextView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:expandableTextView="http://schemas.android.com/apk/res-auto" android:id="@+id/expand_text_view" android:layout_width="match_parent" android:layout_height="wrap_content" expandableTextView:maxCollapsedLines="4" expandableTextView:animDuration="200"> <TextView android:id="@id/expandable_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:textSize="16sp" android:textColor="#666666" /> <ImageButton android:id="@id/expand_collapse" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="16dp" android:layout_gravity="right|bottom" android:background="@android:color/transparent"/> </com.ms.square.android.expandabletextview.ExpandableTextView>
Set your text to the "@+id/expand_text_view" not in "@id/expandable_text". It will work
@AhmMhd @Manabu-GT I am having the same problem. The view is not inflating or being recognized in my xml for some reason. I have it in its own xml in a linear layout but the linear layout is showing empty and when I click on the layout nothing in the blueprint is highlighting. Any suggestions?
never mind, figured it out =]
Can you please tell me the solution?
I had to put the linear layout in a scrollview for it to be visible. It's still not showing in my blueprint but when I run it on my emu or phone it shows up.
<ScrollView android:id="@+id/detail_scrollView" android:layout_width="match_parent" android:layout_height="wrap_content" android:nestedScrollingEnabled="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/expand_detail_view"
layout="@layout/expand_text_item"/>
</LinearLayout>
</ScrollView>