Manabu-GT / ExpandableTextView

Android's TextView that can expand/collapse like the Google Play's app description
Apache License 2.0
4.08k stars 791 forks source link

Write the widget in xml ,but show nothing in screen.Anything wrong? #63

Open SunJenry opened 6 years ago

AhmMhd commented 6 years ago

<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

NaturallyAsh commented 5 years ago

@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?

NaturallyAsh commented 5 years ago

never mind, figured it out =]

Komal-Khairnar commented 5 years ago

Can you please tell me the solution?

NaturallyAsh commented 5 years ago

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>