
- Forum-Beiträge: 717
25.12.2014, 17:19:51 via Website
25.12.2014 17:19:51 via Website
Hey Leute,
ich habe gerade folgendes Problem.
Und zwar möchte ich eine Liste machen (soweit kein Problem).
Dann möchte ich links ein Bild (quadratisch) und dann zwei Texte.
Mein Code sieht derzeit so aus:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/header"
android:text="Header"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/imageView"
android:textColor="@color/abc_primary_text_material_light"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text"
android:text="Text"
android:layout_below="@+id/header"
android:layout_alignLeft="@+id/header"
android:layout_alignStart="@+id/header"
android:textColor="@color/abc_secondary_text_material_light"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="@+id/text" />
</RelativeLayout>
Von der Höhe her passt sich das Bild an den Text an (so soll es sein) von der Breite her, entsteht aber ein breiter weißer Rand, je größer das Bild ist.
Ich hoffe mir kann da jemand helfen.
MfG
Lucas