我有以下布局。当我在Eclipse的图形布局视图中查看它时,它看起来很好。但是在电话上时,这并未反映出来。相对布局在Eclipse中看起来不错,但不在设备上
在电话上,TextView rowlogmessage
占据了整个视野,其他TextView
被压在了底部。
任何想法为什么?
<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>
谢谢,工作正常 – turtleboy 2014-09-05 09:57:58
很高兴知道这一点。我也使用这种技术。 ;) – 2014-09-05 10:10:06
用于命名约定。这不是java它是XML。 – 2016-03-13 22:03:04