je dois mettre en œuvre l'interface suivante: TextView dans un mauvais alignement RelativeLayout
Pour cela, je me sers de la mise en page suivante:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white">
<ImageView
android:id="@+id/news_image0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/news_cell0_imageview_min_height"
android:adjustViewBounds="true"
android:scaleType="fitXY" />
<RelativeLayout
android:id="@+id/news0_cell_image_overlay_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/news_image0"
android:layout_alignTop="@+id/news_image0"
android:layout_alignLeft="@+id/news_image0"
android:layout_alignStart="@+id/news_image0"
android:layout_alignEnd="@+id/news_image0"
android:layout_alignRight="@+id/news_image0"
android:background="@drawable/news_cell0_overlay_gradient">
<TextView
android:id="@+id/news_title0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_vertical|start"
android:layout_alignParentBottom="true"
android:maxLines="3"
android:ellipsize="end"
android:textColor="@color/colorNewsCellType0TitleText"
android:layout_margin="@dimen/news_cell0_textview_margin"
android:textSize="@dimen/news_cell0_title_text_size"
android:typeface="monospace" />
</RelativeLayout>
</RelativeLayout>
Dans le ImageView je chargeais image à l'aide Picasso d'un URL Je reçois la sortie correctement dans la plupart des appareils, mais dans certains des appareils fonctionnant sous Android moins Lollipop, cela se présente comme la capture d'écran ci-dessous. Le texte apparaît en haut, au lieu de bas. Mais j'ai mis android:layout_alignParentBottom="true"
pour le TextView. Le RelativeLayout
est rendu correctement, et il correspond à l'image (il a un dégradé d'arrière-plan, qui peut être clairement vu au bas de l'image).
Quelle est la cause de ce problème et comment puis-je résoudre ce problème?
android: layout_alignParentBottom = "true" pour news0_cell_image_overlay_layout – Raj