Android : Relative layout looks ok in Eclipse, but not on device

on Friday, September 5, 2014


I have the following layout. It looks ok when I view it within the graphical layout view in Eclipse. But when on a phone, this is not reflected.


On a phone the TextView rowlogmessage takes up the whole view and the other TextViews are crushed at the bottom.


Any ideas why?



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/rounded_corners_white" >

<TextView
android:id="@+id/rowlogmessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="log message goes here"
android:textColor="#707070"
android:layout_alignParentTop="true" />

<TextView
android:id="@+id/rowlogcreatedat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="log message created at"
android:textColor="#707070"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" />

<TextView
android:id="@+id/rowlogcreatedatlabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Created at"
android:layout_alignParentLeft="true"
android:layout_above="@id/rowlogcreatedat"
android:paddingTop="10dp" />

<TextView
android:id="@+id/rowlogsentserver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="log message sent to server"
android:textColor="#707070"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />

<TextView
android:id="@+id/rowlogsentserverlabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sent to server"
android:layout_alignParentRight="true"
android:layout_above="@id/rowlogsentserver"
android:paddingTop="10dp"/>

</RelativeLayout>

0 comments:

Post a Comment