2013-08-20 119 views
-1

在我的代碼中,image1顯示在左側,但圖像test_button_image2不在屏幕右側移動我該怎麼辦?這是我的截圖如何移動圖像並將其與屏幕右側對齊

i灣tomake likie這

請幫助我如何移動圖像2的佈局嗎?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#ffffff" 
    android:orientation="vertical" > 


    <LinearLayout 

    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="@drawable/imagelogo2" 

    android:orientation="horizontal" > 

    <ImageView 
      android:id="@+id/test_button_image" 
      android:layout_width="wrap_content" 
      android:paddingLeft="5dp" 
      android:layout_height="wrap_content" 

      android:paddingTop="15dp" 
      android:src="@drawable/back" > 
     </ImageView> 

     <ImageView 
     android:id="@+id/test_button_image2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 

     android:paddingLeft="5dp" 
     android:paddingTop="15dp" 
     android:src="@drawable/back" /> 

    </LinearLayout> 

    <LinearLayout 
     android:id="@+id/lytContent" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/txtCopyright" 
     android:layout_marginTop="10dp" 
     android:background="@drawable/border2" 
     android:layout_below="@+id/lytTitlebar" 
     android:orientation="vertical" > 



     <ListView 
      android:id="@+id/listMainMenu" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 

      android:listSelector="@drawable/listview_selector" 
      android:dividerHeight="1dip" 
      android:fadeScrollbars="true" /> 
     </LinearLayout> 



    </LinearLayout> 
+0

可能重複[如何在兩個ImageViews之間消除空間?(http://stackoverflow.com/questions/18330788/如何去除的空間功能於兩imageviews間) – Renjith

回答

0

這種佈局是有點凌亂,但是從我所看到的:

  1. 你大學的標誌被設置爲佈局(android:background="@drawable/imagelogo2")的背景。看起來你需要將它移動到一個單獨的ImageView中。

  2. 您有2個ImageViews顯示後退按鈕。

  3. 請考慮使用邊距而不是填充。我認爲這會更適合你想要做的事情。

0

試試這個

機器人:layout_gravity = 「右」

相關問題