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

How to hide the image button and create custom button? #62

Closed tanwanjern closed 6 years ago

tanwanjern commented 6 years ago

Hi, I want to remove the image button and add my custom button but it will crash, so I tried to hide the image button but this code is not working android: visibility="gone" . the image button will display even I added this code. So how to hide it?

My custom button just displays a 'Read More' text and no image.

Or I have to create 'read more' image for it? any other solution?

<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"
                    android:layout_marginTop="30dp"
                    expandableTextView:animDuration="200">

                    <TextView
                        android:id="@id/expandable_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textColor="#666666"
                        android:textSize="16sp" />

                    <ImageButton
                        android:id="@id/expand_collapse"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="left|bottom"
                        android:background="@android:color/transparent"
                        android:visibility="gone"
                        android:padding="16dp"
                        android:text="Read More"
                        android:textColor="@color/colorSweat"/>
                </com.ms.square.android.expandabletextview.ExpandableTextView>
tanwanjern commented 6 years ago

I found the solution. android:layout_width="0dp" android:layout_height="0dp"