2013-05-07 145 views
1

在我的佈局,有一個ImageView的和一個Button(他們有botonordenes,並imagelogo爲ID:安卓:layout_alignBottom不能正常工作

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/fondo_descripcion_campania" 
tools:context=".AlertDetailActivity" > 

<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:src="@drawable/logotipo_high_density_vinceri_movil" /> 

<ImageView 
    android:id="@+id/imageView4" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_below="@+id/imageView1" 
    android:src="@drawable/titulo_orden_trabajo_oncheck_high_density_vinceri_movil" /> 

<ImageView 
    android:id="@+id/imageView6" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true" 
    android:src="@drawable/footer" /> 

<Button 
    android:id="@+id/botonrechaza" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignBaseline="@+id/botonacepta" 
    android:layout_alignBottom="@+id/botonacepta" 
    android:layout_toRightOf="@+id/botonacepta" 
    android:background="@drawable/rechazar_azafata_orden_trabajo_oncheck_high_density_vinceri_movil" /> 

<Button 
    android:id="@+id/botonacepta" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/imageView6" 
    android:layout_alignParentLeft="true" 
    android:background="@drawable/aceptar_azafata_orden_trabajo_oncheck_high_density_vinceri_movil" /> 

<Button 
    android:id="@+id/botonordenes" 
    android:layout_width="wrap_content" 
    android:layout_height="30dp"  
    android:layout_toRightOf="@+id/imagelogo" 
    android:layout_below="@+id/nombrecampaign" 
    android:layout_marginLeft="20dp" 
    android:layout_marginRight="10dp" 
    android:layout_marginTop="20dp" 
    android:background="@drawable/btn_ver_ordenes_trabajo" /> 

<ImageView 
    android:id="@+id/botonalertdetailshome" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/imageView4" 
    android:layout_alignParentRight="true" 
    android:src="@drawable/home_high_density_vinceri_movil" /> 

<ImageView 
    android:id="@+id/botonalertdetailsos" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/botonrechaza" 
    android:layout_alignParentTop="true" 
    android:src="@drawable/icono_sos_vinceri_movil_azafatas" /> 

<TextView 
    android:id="@+id/nombrecampaign" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/botonordenes" 
    android:layout_below="@+id/imageView4" 
    android:text="Nombre Campaña" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:textColor="#FFFFFF" /> 

<Button 
    android:id="@+id/botonubicaciones" 
    android:layout_width="wrap_content" 
    android:layout_height="30dp" 
    android:layout_alignBottom="@+id/imageView2" 
    android:layout_alignLeft="@+id/botonordenes" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="10dp" 
    android:layout_marginRight="10dp" 
    android:background="@drawable/btn_ver_ubicaciones_campania" /> 



<TextView 
    android:id="@+id/textdescenc" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="14dp" 
    android:layout_toRightOf="@+id/imageView5" 
    android:layout_alignBottom="@+id/imageView5" 
    android:text="@string/desc" 
    android:textAppearance="?android:attr/textAppearanceSmall" /> 

<ImageView 
    android:id="@+id/imageView3" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerVertical="true" 
    android:layout_marginRight="15dp" 
    android:layout_toLeftOf="@+id/textofechainicioenc" 
    android:src="@drawable/icono_calendario" /> 

<ImageView 
    android:id="@+id/imageView5" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/imageView3" 
    android:layout_below="@+id/imageView3" 
    android:layout_marginTop="14dp" 
    android:src="@drawable/icono_descripcion" /> 

<TextView 
    android:id="@+id/textdetailfechainicio" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignBottom="@+id/imageView3" 
    android:layout_toRightOf="@+id/textofechainicioenc" 
    android:text="Small Text" 
    android:textAppearance="?android:attr/textAppearanceSmall" /> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="64dp" 
    android:layout_above="@+id/botonrechaza" 
    android:layout_alignLeft="@+id/imageView3" 
    android:layout_alignParentRight="true" 
    android:layout_below="@+id/textdescenc" 
    android:orientation="vertical" > 

    <TextView 
     android:id="@+id/textdescdetail" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Small Text" 
     android:textAppearance="?android:attr/textAppearanceSmall" /> 
</LinearLayout> 

<TextView 
    android:id="@+id/textofechainicioenc" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignBottom="@+id/imageView3" 
    android:layout_alignRight="@+id/imageView1" 
    android:layout_marginRight="15dp" 
    android:text="@string/fechainicio" 
    android:textAppearance="?android:attr/textAppearanceSmall" /> 

<ImageView 
    android:id="@+id/imageView2" 
    android:layout_width="70dp" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_below="@+id/imagelogo" 
    android:layout_marginTop="10dp" 
    android:src="@drawable/icono_mapa_ubicacion" /> 

<ImageView 
    android:id="@+id/imagelogo" 
    android:layout_width="69dp" 
    android:layout_height="65dp" 
    android:layout_alignBottom="@+id/botonordenes" 
    android:layout_alignRight="@+id/imageView2" /> 

正如你所看到的,像有機器人:layout_alignBottom =「@ + id/botonordenes」。問題是,alignbottom工作不正常。在模擬器中可以看到,但不是在我的設備中。圖像的底部行與按鈕,區別不是很多,但它是可見的,爲什麼不對齊?我試圖設置一個邊緣,希望它會推動圖像有點對齊,但不工作。爲什麼會發生這種情況,以及如何解決它?謝謝。

回答

0

它或者與Buttons預定義的保證金或在ImageView

您的硬編碼 heightwidth值做
0

您可能會看到的是默認android和默認按鈕上使用的圖像上實現的內容之間的區別。嘗試使用Holo主題之一,看看你是否仍然有同樣的問題。