android layout pushing views from the screen

Lwelch45

New Member
For building an application, we have serveral lists. the problem exists with a list item, which is custom, but very simple nontheless.The format is:
vpCm4.png
This represents one list item with 2 textviews and one image viewNote that title and date are actually right underneath eachother and the image is on the right side, with center vertical as attribute.The image should NOT be in between the two text viewsI will give the XML first and then explain the exact problem.The XML: \[code\]<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:textSize="16dip" android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:textSize="12dip" android:id="@+id/date" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> <RelativeLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginRight="5dip" > <ImageView android:id="@+id/validationStateImg" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentRight="true" android:layout_centerVertical="true" /> </RelativeLayout></LinearLayout>\[/code\]Problem:In some sense, this layout displays everything exactly as the ascii representation.What does NOT function correctly is when the text is becoming long. In cases where the text is long, but not long enough to take 2 lines, it just makes the imageview tiny. In other cases, it just pushes imageview completely off the screen..What I need is, when the length of either the date or the other textview is too long, to break to a new line. And ofcourse it needs to be a solution portable to all sorts of screen sizes.Im not a UI artist, so, apologies if im abusing layouts in a sense that they should not be used.Aside help, tips and hints are also welcome! Thanks for reading.
 
Back
Top