2012-08-13 43 views
1

我正在開發一個Android項目,我需要在其中繪製一個UI,如下所示。我需要將android屏幕分成兩半。在上半場我需要顯示谷歌mps。在下半部分,只要有人點擊Google Maps,我就需要顯示用戶信息。上半部分已完成併爲我工作。在屏幕下半部分顯示圖像和用戶信息

問題陳述: - I m具有在設計下半區部分UI麻煩

。下面的UI應該是main.xml file。每當我點擊markers on the Mapinformation應顯示在Android屏幕的下半部分。以下是我在塗料 上的設計,其中包含一個圖像和android屏幕底部的用戶信息。

enter image description here

這是我目前的main.xml file,我需要修改,看起來像上面的圖像。

<?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="fill_parent" 
    android:orientation="vertical" > 

    <com.google.android.maps.MapView 
     android:id="@+id/mapView" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:apiKey="0vAX8Xe9xjo5gkFNEEIH7KdHkNZNJWNnsjUPKkQ" 
     android:clickable="true" 
     android:enabled="true" /> 

    <TextView 
     android:id="@+id/textView" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:text="TextView" /> 

</LinearLayout> 

回答

2

你可以試試這個:

<?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="fill_parent" 
    android:orientation="vertical" > 

    <com.google.android.maps.MapView 
     android:id="@+id/mapView" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:apiKey="0vAX8Xe9xjo5gkFNEEIH7KdHkNZNJWNnsjUPKkQ" 
     android:clickable="true" 
     android:state_enabled="true" /> 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:baselineAligned="false" 
     android:orientation="horizontal"> 

     <LinearLayout 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_weight="0.7" 
      android:orientation="vertical"> 

      <ImageView 
       android:src="@drawable/icon" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:layout_marginTop="45dp" 
      /> 

    </LinearLayout> 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="0dp" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:orientation="vertical"> 

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"     
      android:layout_marginTop="45dp"   
      android:text="Name:" /> 

     <TextView 
      android:id="@+id/textView2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"     
      android:text="Gender:" /> 

     <TextView 
      android:id="@+id/textView3" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"     
      android:text="Distance:" />   

     <TextView 
      android:id="@+id/textView4" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"     
      android:text="Latitude:" /> 

     <TextView 
      android:id="@+id/textView5" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"     
      android:text="Longitude:" /> 
    </LinearLayout> 

    </LinearLayout> 

</LinearLayout> 

enter image description here

希望這是你在找什麼。

相關問題