2014-05-02 35 views
0
<?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" > 

    <RelativeLayout 
     android:id="@+id/contact_relMainHeader" 
     android:layout_width="match_parent" 
     android:layout_height="50dip" 
     android:background="#16A180" 
     android:padding="5dp" > 

     <ImageView 
      android:id="@+id/contact_btnMenu" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_centerVertical="true" 
      android:layout_marginBottom="5dip" 
      android:layout_marginTop="5dip" 
      android:src="@drawable/scrol" /> 

     <ImageView 
      android:id="@+id/contact_btnLogout" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_centerVertical="true" 
      android:layout_marginBottom="5dip" 
      android:layout_marginTop="5dip" 
      android:src="@drawable/lock" /> 

     <ImageView 
      android:id="@+id/textView" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:layout_centerVertical="true" 
      android:gravity="center" 
      android:src="@drawable/centertext" /> 
    </RelativeLayout> 

</RelativeLayout> 

分區活動,這是我目前的屏幕看起來像這樣。 http://snag.gy/kwjAn.jpg我必須使佈局3分區的垂直第一對谷歌地圖,第二個用於姓名顯示和,三一個聊天窗口實際上我已經使鋪陳像〜4這10部分:2:4 3segement http://snag.gy/exrsu.jpg這樣佈局。請幫我無法做到這一點。如何在3份不同的控制

回答

0

試試這個......

<?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" > 

    <RelativeLayout 
     android:id="@+id/contact_relMainHeader" 
     android:layout_width="match_parent" 
     android:layout_height="50dip" 
     android:background="#16A180" 
     android:padding="5dp" > 

     <ImageView 
      android:id="@+id/contact_btnMenu" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_centerVertical="true" 
      android:layout_marginBottom="5dip" 
      android:layout_marginTop="5dip" 
      android:src="@drawable/ic_launcher" /> 

     <ImageView 
      android:id="@+id/contact_btnLogout" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_centerVertical="true" 
      android:layout_marginBottom="5dip" 
      android:layout_marginTop="5dip" 
      android:src="@drawable/ic_launcher" /> 

     <ImageView 
      android:id="@+id/textView" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:layout_centerVertical="true" 
      android:gravity="center" 
      android:src="@drawable/ic_launcher" /> 
    </RelativeLayout> 

    <LinearLayout 
     android:layout_below="@+id/contact_relMainHeader" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:orientation="vertical" 
     > 

     <LinearLayout 
     android:layout_weight="40" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:background="#ff0000" 
     android:orientation="vertical" 
     > 

</LinearLayout> 


     <LinearLayout 
     android:layout_weight="20" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:orientation="vertical" 
     android:background="#000000" 
     > 

</LinearLayout> 


     <LinearLayout 
     android:layout_weight="40" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:orientation="vertical" 
     android:background="#ffff00" 
     > 

</LinearLayout> 


</LinearLayout> 
</RelativeLayout> 
0

Fragments將有助於你得到想要的結果。我無需編寫代碼(......你需要把這項工作)向你解釋的邏輯。你的佈局應該有3個片段

  1. mapfagment可以在頂部。 Mapfragments

  2. 這之後可以是包含一個TextView的片段。

  3. ,最後一個將包含你的聊天窗口。

相關問題