1

its the fist time I watch my app in a tablet, I always used mobiles.

It's a nexus 7, and its not beauty.

enter image description here

I ckecked adding a l, m, h and xh that it uses h density, but the button are small.

the last button has the same width than the background but it doesn't fix the screen.

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:background="@drawable/background"
>

    <ImageButton
        android:id="@+id/account_but"
        android:background="@null"
        android:contentDescription="@string/accountDesc"
        android:layout_marginTop="50dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/boton_usos" />

    <ImageButton
        android:id="@+id/alquilar_but"
        android:background="@null"
        android:contentDescription="@string/alquilarDesc"
        android:layout_marginTop="5dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/boton_alquilar" />


    <ImageButton
        android:id="@+id/paradas_but"
        android:background="@null"
        android:contentDescription="@string/paradasDesc"
        android:layout_marginTop="5dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/boton_paradas" />

    <ImageButton
        android:id="@+id/noticias_but"
        android:background="@null"
        android:contentDescription="@string/noticiasDesc"
        android:layout_marginTop="5dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/boton_noticias" />

    <ImageButton
        android:id="@+id/incidencia_but"
        android:background="@null"
        android:contentDescription="@string/incidenciaDesc"
        android:layout_marginTop="5dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/boton_incidencia" />

     <ImageButton
        android:id="@+id/informacion_but"
        android:background="@null"
        android:contentDescription="@string/infoDesc"
        android:layout_marginTop="5dip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/boton_informacion" />


    <ImageButton
            android:id="@+id/banner_but"
            android:background="@null"
            android:contentDescription="@string/infoDesc"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:src="@drawable/banner" />  

    </LinearLayout>

how can I made bigger the hdpi button??

user1256477
  • 10,763
  • 7
  • 38
  • 62

1 Answers1

1

It's better to include the whole layout. It seems that one of your parent layouts has restrictions on width.

mdv
  • 91
  • 3
  • Do you use 9patch in your @drawable? It will use drawable size if you won't tell android how to stretch your image. – mdv Mar 18 '13 at 12:59
  • what is patch in drawable? – user1256477 Mar 18 '13 at 13:00
  • Google it: [one](http://developer.android.com/tools/help/draw9patch.html) and [two](http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch). It helps to explain android how to stretch your images for different screen sizes and also it helps not to care about differences of screen sizes in Android. – mdv Mar 18 '13 at 13:02
  • I tried it, but as I understand, it makes bigger or shorter the button depending on the text, isnt it? I want it's bigger with tablets. – user1256477 Mar 18 '13 at 15:16
  • No. Donwload this hdpi [icon](http://db.tt/T5cHzFEW) and set it as a background to button. Then check its behavior with width of button set to fill_parent and eg 40dp. Or open sdk/tools/draw9patch to see how this image will be stretched and you will understand. – mdv Mar 20 '13 at 14:53