2011-11-23 24 views
0

我在我的Android xml文件設計此佈局我怎麼給填充到其內部的LinearLayout圖像,而無需增加的LinearLayout寬度的Android

enter image description here

我把2線性佈局1頁眉和其他的身體。到目前爲止都很好。在標題班輪佈局中,我添加了非常好的背景圖像。

現在,當我爲搜索和信息添加最右邊的圖像按鈕時,我希望它們完全按照上圖所示漂浮通過標題線性佈局。但問題是,如果我把它們放入標題的襯裏佈局中,襯裏佈局的寬度會增加,並且它們都在標題佈局下。無論如何,我可以做到這一點?

感謝

回答

0

嘗試這種組合:

<AbsoluteLayout 
    android:id="@+id/widget68" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    > 
    <FrameLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_x="40px" 
     android:layout_y="35px" 
     >   
     <ImageView 
      android:src = "@drawable/androidlogo" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      />    
     <Button 
      android:layout_width="124px" 
      android:layout_height="wrap_content" 
      android:text="Print Picture"  
      /> 
    </FrameLayout> 
</AbsoluteLayout> 

得到這個:

Frame layout

您也可以通過填充它

移動你的圖片(在這種情況下按鈕)
相關問題