Pedro,

I haven't look in too much detail (the links to images are not clickable), but here is what jumped at me:

- You use some layout attributes that are not applicable to RelativeLayout, like layout_gravity, orientation, etc. Looks like leftovers from a conversion from LinearLayout. Use layout_centerVertical="true" instead.

- android:layout_below="@id/cities_main_layout" is wrong, since cities_main_layout is the id of the RelativeLayout itself (and an id is not needed there). Use layout_alignParentTop instead.

- As for dip (dp) units, fixed values (if needed) work pretty well for screen width in portrait orientation, but not so well for screen height. Use layout_weight (inside a LinearLayout) or layout_above / layout_below inside a RelativeLayout instead.

-- Kostya


05.01.2011 18:33, pedr0 пишет:
Hi at all,

I have some problem with multiple screen support, I work with dp(dpi)
for specify the layout_heigth and layout_width and I hope that is the
better way to support multiple screen, but when I tried with two
smartphone I meet two different result.

I give an example, this is a layout I use:

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
                                                         
android:id="@+id/cities_main_layout"
                                                         
android:orientation="vertical"
                                                         
android:layout_width="fill_parent"
                                                         
android:layout_height="fill_parent"

                                                        >



                                        <ListView
                                                android:id="@+id/citieslist"
                                                
android:layout_width="wrap_content"
                                                android:layout_height="320dip"
                                                
android:layout_gravity="center_vertical"
                                                
android:layout_below="@id/cities_main_layout"
                                        />

                                        <LinearLayout
                                                         
android:id="@+id/cities_button_layout"
                                                         
android:orientation="horizontal"
                                                         
android:layout_width="wrap_content"
                                                         
android:layout_height="wrap_content"
                                                         
android:layout_below="@id/citieslist"
                                                         
android:layout_gravity="center_vertical"
                                        >
                                                <Button
                                                        
android:id="@+id/bycountry"
                                                android:layout_height="50dip"
                                                android:layout_width="105dip"
                                                
android:background="@drawable/buttonmarket"
                                                
android:text="@string/button_bycountry"
                                        />
                                        <Button
                                                        android:id="@+id/top10"
                                                android:layout_height="50dip"
                                                android:layout_width="105dip"
                                                
android:background="@drawable/buttonmarket"
                                                
android:text="@string/button_top10"
                                        />
                                        <Button
                                                        
android:id="@+id/recommended"
                                                android:layout_height="50dip"
                                                android:layout_width="105dip"
                                                
android:background="@drawable/buttonmarket"
                                                
android:text="@string/button_recommended"
                                        />

                                        </LinearLayout>

                        </RelativeLayout>


The button are at the bottom of the layout, and I see two different
result:

img600(dot)imageshack(dot)us/img600/5513/htcmagicg2(dot)png

img441(dot)imageshack(dot)us/img441/6440/samsunggalaxys(dot)png

In the last smartphone I can see the buttons, instead in the first I
cannot...what's wrong?

I have to write a layout for any set of screen??!!!



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to