2012-05-30 137 views
0

我想設計一個頁面,我面臨着三個問題。android佈局設計問題

第一個問題是設計爲在頂部的下圖 enter image description here

這裏漢堡圖像(從URL)必須是與置於其上具有圓形圖像一起等於餘量空間隨機更改的文本。下面是確定和取消按鈕,灰色背景和紅色圖標正好在中間。紅色圖標的一小部分必須放在上面的圖像和2下面編輯文本和文本視圖

第二個問題是我在我的應用程序欄中有一個按鈕,當它點擊漢堡圖像視圖必須被清除,我必須在其中顯示一張地圖。在這種情況下,紅色圖標必須保留在其位置上,並在地圖上留下一小部分。

我不知道有關ImageView的高度和寬度,但該地圖必須在圖像

第三個問題是我想不滾動視圖設計這個頁面,視圖的位置準確地更換必須在屏幕內,因爲如果我們要使用框架佈局它是不是一個滾動視圖

到目前爲止,我已經嘗試過內接受以下

<LinearLayout 
      android:id="@+id/rrds_layout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_margin="5dp" 
      android:background="@color/burgerimg" > 
       <RelativeLayout 
        android:id="@+id/rrds_round_points" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:background="@drawable/rounded_bg" > 
        <TextView 
         android:id="@+id/textView1" 
         android:layout_centerInParent="true" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:text="Free" 
         android:textColor="#000000" 
         android:textAppearance="?android:attr/textAppearanceMedium" /> 
       </RelativeLayout> 
     </LinearLayout> 

我不知道的T方式o增加了紅色圖標和按鈕一點點在圖像

如何設計這個網頁.....

Vikram Bodicherla解釋我已經設計瞭如下

<FrameLayout> 
    <ViewSwitcher> 
      <TextView></TextView> 
      <MapView></MapView> 
    </ViewSwitcher> 

     <RelativeLayout 
      android:id="@+id/rrds_merge_layout2" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="bottom"> 

       <ImageView 
        android:contentDescription="@string/app_name" 
        android:id="@+id/merge_bg_img" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:background="@drawable/title_bg" 
        android:layout_centerInParent="true"/> 

       <TextView 
        android:id="@+id/merge_view_pro_txt" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="OK" 
        android:layout_centerInParent="true" 
        android:clickable="true" 
        android:textAppearance="?android:attr/textAppearanceMedium" 
        android:layout_toLeftOf="@+id/merge_center_img" 
        android:layout_centerVertical="true"/> 

       <ImageView 
        android:contentDescription="@string/app_name" 
        android:id="@+id/merge_center_img" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerInParent="true" 
        android:background="@drawable/red_icon" /> 

       <TextView 
        android:id="@+id/merge_view_cash_txt" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerInParent="true" 
        android:clickable="true" 
        android:text="@string/mrg_cash" 
        android:textAppearance="?android:attr/textAppearanceMedium" 
        android:layout_toRightOf="@+id/merge_center_img" 
        android:layout_centerVertical="true"/> 
     </RelativeLayout> 
</FrameLayout> 

但仍然是相同的存在問題......

+0

1.對圖像使用透明邊框。 2.使用relativeview設計你的紅色圖標欄。 3.使用你的父母作爲相對視圖。 –

+0

@CasperOne - 其中2人能夠理解,有人給了我60%的解決方案,我正在嘗試。 –

回答

1

分別設計頂部和底部。

在頂部,有一個FrameLayout/ViewSwitcher在MapView和ImageView之間交換。至於圓形圖像,創建一箇中間有一個白色圓形的圖像,其他所有部分都是透明的。將其設置爲TextView的背景並編寫文本。

第二部分的設計相當簡單。

讓我知道你是否需要針對特定​​問題的代碼。

+0

感謝Vikram,但沒有用...我已經添加了我的XML,有什麼建議嗎? –

+0

對不起,我不明白?! –

+0

正如你已經解釋過的,我嘗試過使用FrameLayout和View Switcher,但仍然是底部(紅色圖標與文字兩邊)位於圖像/地圖上。我在我的問題中添加了新的佈局設計,並提及您的名字...... –