我想顯示一個片段上面的RelativeLayout沒有成功。Android的RelativeLayout片段以上
在這裏,我的xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#5C5A59"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="5dp" >
</RelativeLayout>
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center|bottom"
android:background="#5C5A59"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<TextView
android:id="@+id/lbl_altitude"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/lbl_altitude"
android:textColor="#00FFFF"
android:layout_alignParentBottom="true" />
</RelativeLayout>
</LinearLayout>
使用此代碼的片段總是需要在屏幕的整體大小和我的RelativeLayout上述心不是顯示。
預先感謝您。
非常感謝你,使用佈局權重一切都完美! – user2802154 2014-09-04 14:39:12