Problem when dealing with multiple screen sizes

by lou » Fri, 20 May 2011 18:04:16 GMT


Sponsored Links
 Hi !
I have some problems when dealing with different resolutions and sizes
of screen : my goal is to display an image in a square which is draw
in my background picture.
I have a main RelativeLayout which is filling the entire screen :

<RelativeLayout xmlns:android=" http://schemas.android.com/apk/res/ 
android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/my_background">
    <ImageView ...
        android:id="@+id/my_imageview"
        android:src="@drawable/my_image" />
</RelativeLayout>

In my background picture, there is a square ( for example at 10px from
the left and 40px from the top of the picture ). I want to display the
ImageView my_imageview IN this square.
In my manifest :

    <supports-screens android:normalScreens="true" />
    <supports-screens android:largeScreens="true" />
    <supports-screens android:smallScreens="true" />
    <supports-screens android:anyDensity="true" />

I tried to set my_imageview parameters like that :

<ImageView
    ...
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="40dip"
    android:layout_marginLeft="10dip" />

But even with 3 types of drawable ( hdpi -> 1.5x, mdpi -> 1x, ldpi ->
0.75x), the imageview is not always displayed in the square.
For this  example :
- HVGA - MDPI : OK
- HVGA - HDPI : the imageview is underneath the square
- WVGA - HDPI : the imageview is a little over the square
- WVGA - HDPI : the imageview is a lot over the square
I also tried to set the layout_marginTop and the layout_marginLeft
three times ( values-small, values-normal, values-large ), but there
are still some bugs..

Is there anybody who can help me with that ?

Thanks, a lot !!
Regards

-- 



Other Threads

1. Webview shouldOverrideUrlLoading not called for https

Hi,
i've found out that when loadURL() for https site, the
shouldOverrideUrlLoading() is not called. i've tried loading http and
it works.
Anyone knows what to do to make it works?
thanks >.<

2. Fw: [kassmadji01] Fw: [Konsultasi-Kesehatan] Pijat Ala Chandra

------Original Message------
From: dryudhis...@gmail.com
Sender: Kassmadji
To: Kassmadji
ReplyTo: Kassmadji
Subject: [kassmadji01] Fw: [Konsultasi-Kesehatan] Pijat Ala Chandra
Sent: Jan 12, 2010 13:05

 Omong omong tukang pijat *ini bukan chacha.. 
pm&fb yudhis...@gmail. com ym yudhistyaksyatria sent from gadget bukan pc/mac
From: "Rachel" <rachel.stefanie@ muliagroup. co.id> Date: Tue, 12 Jan 2010 
11:25:56 +0700 To: <Konsultasi-Kesehata n...@yahoogroups. com> Subject: 
[Konsultasi- Kesehatan] Pijat Ala Chandra  Permisi Pak/bu Mod... > Dear all, 
tunarungu, karena pendengarannya juga terganggu. Dia bekerja memijat. Namanya 
Chandra, dia sudah menikah dengan sesama tunanetra, dan mempunyai seorang anak. 
Terakhir dia minta tolong kepada saya untuk coba mempromosikannya lewat media 
internet. Dia bukan hanya pandai memijat biasa , tapi juga pijat refleksi. 
Kalau ada pasien yang memanggilnya, biasanya dia datang dengan ojek. Mungkin 
ada teman-teman di sini yang sedang membutuhkan jasa pijat, bisa coba pijat ala 
Chandra ini. Dijamin deh MAKNYOS!!! :) Langsung aja hubungi 087885871132, 
dengan Yenny (Isteri Chandra). Kalau mau SMS, bisa ke nomor Chandra langsung: 
085718919775. (Karena HP Chandra sudah diinstal program bicara, jadi Chandra 
bisa baca SMS sendiri) Harga pijatnya Rp. 40 per jam. Untuk ongkos ojek 
biasanya pasien yang bayarin, Chandra tinggal di Jalan Kemurnian _ Glodok. 
Saya sangat berharap dengan mempromosikan Chandra lewat milis ini bisa membantu 
mencarikannya pasien-pasien baru, dan dengan demikian bisa sedikit meringankan 
beban ekonomi keluarga Chandra, karena walau bagaimana pun Chandra adalah 
kepala rumah tangga yang memiliki tanggungjawab terhadap isteri dan anaknya. 
Sebelumnya saya mengucapkan terimakasih banyak kepada pak/bu Moderator milis 
karena sudah mengijinkan promosi ini, dan kepada teman-teman semua yg sekiranya 
mau mencoba pijat ala Chandra atau menyampaikan kepada teman-teman, 
saudara-saudara, atau kepada siapapun tentang pijat ala Chandra ini. Tuhan 
memberkati.. . > Cheers, > Rachel   CONFIDENTIALITY CAUTION: This 
message is intended only for the use of the individual or entity to whom it is 
addressed and contains information that is privileged and confidential. If you, 
the reader of this message, are not the intended recipient, you should not 
disseminate, distribute or copy this communication. If you have received this 
communication in error, please notify us immediately by return email and delete 
the original message. __._,_.___ Reply to sender | Reply to group Messages in 
this topic (1) Recent Activity: New Members 1 Visit Your Group Start a New 
Topic MARKETPLACE Going Green: Your Yahoo! Groups resource for green living
Switch to: Text-Only, Daily Digest Unsubscribe Terms of Use . __,_._,___ 
Regards Anindityo Aryo Saloko
Try not to become a man of success but rather to become a man of value.
Albert Einstein

-- 
--------------------
"Indonesian Android Community [id-android]" 

Join,  visit the following page:

3. Mobile App Socialization - We Need an API

4. question on reading from socket in android ...

5. Nx1 - It's Scratch Resistant

6. Paging Boss Meykel

7. documentaion on customization of Androi