android - ImageView overlaps with TextView in ConstraintLayout -
i using recyclerview , code activity_main:
<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.constraintlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.romin.apodbrowser.mainactivity"> <android.support.v7.widget.recyclerview android:id="@+id/recyclerview" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginbottom="8dp" android:layout_marginleft="8dp" android:layout_marginright="8dp" android:layout_margintop="8dp" android:scrollbars="vertical" app:layout_constraintbottom_tobottomof="parent" app:layout_constrainthorizontal_bias="0.0" app:layout_constraintleft_toleftof="parent" app:layout_constraintright_torightof="parent" app:layout_constrainttop_totopof="parent" /> </android.support.constraint.constraintlayout>
and recyclerview items layout:
<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.constraintlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/list_item" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <org.sufficientlysecure.htmltextview.htmltextview android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginend="8dp" android:layout_marginleft="8dp" android:layout_marginright="8dp" android:layout_marginstart="8dp" android:text="textview" android:textsize="24sp" app:layout_constraintleft_toleftof="parent" app:layout_constraintright_torightof="parent" tools:layout_editor_absolutey="16dp" /> <textview android:id="@+id/pubdate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginend="8dp" android:layout_marginleft="8dp" android:layout_marginright="8dp" android:layout_marginstart="8dp" android:layout_margintop="8dp" android:text="textview" android:textappearance="@style/textappearance.appcompat" app:layout_constraintleft_toleftof="parent" app:layout_constraintright_torightof="parent" app:layout_constrainttop_tobottomof="@+id/link" /> <imageview android:id="@+id/image" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginend="8dp" android:layout_marginleft="8dp" android:layout_marginright="8dp" android:layout_marginstart="8dp" android:layout_margintop="8dp" android:adjustviewbounds="true" android:scaletype="fitstart" app:layout_constrainthorizontal_bias="0.0" app:layout_constraintleft_toleftof="parent" app:layout_constraintright_torightof="parent" app:layout_constrainttop_tobottomof="@+id/pubdate" app:srccompat="@drawable/default_image" /> <org.sufficientlysecure.htmltextview.htmltextview android:id="@+id/description" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_below="@id/image" android:layout_marginbottom="8dp" android:layout_marginend="8dp" android:layout_marginleft="8dp" android:layout_marginright="8dp" android:layout_marginstart="8dp" android:layout_margintop="8dp" android:text="textview" android:textsize="16sp" app:layout_constraintbottom_tobottomof="parent" app:layout_constrainthorizontal_bias="0.0" app:layout_constraintleft_toleftof="parent" app:layout_constraintright_torightof="parent" app:layout_constrainttop_tobottomof="@+id/image" tools:text="description" /> <textview android:id="@+id/link" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginend="8dp" android:layout_marginleft="8dp" android:layout_marginright="8dp" android:layout_marginstart="8dp" android:layout_margintop="8dp" android:text="textview" android:textsize="16sp" app:layout_constrainthorizontal_bias="1.0" app:layout_constraintleft_toleftof="parent" app:layout_constraintright_torightof="parent" app:layout_constrainttop_tobottomof="@+id/title" tools:text="link" /> </android.support.constraint.constraintlayout>
basically, there title @ top, link, , pubdate. there image, , description. besides image (imageview), others textviews.
the problem when load image rss feed imageview, , thumbnail gone, imageview overlaps description textview. have searched everywhere can't seem find solution. understand bitmap changes size , not imageview, , that's what's causing overlap, can't find way fix it.
thank in advance.
screenshot:
remove following line description
:
app:layout_constraintbottom_tobottomof="parent"
this move description view below image. have tested out , working.
i hope helps.
Comments
Post a Comment