hey dannie i need ur help if ur expert in android....am wating for ur
reply....

On 12 July 2012 01:33, DanielleM <[email protected]> wrote:

> Hello all,
>
> I'm having some problems with my layout not displaying correctly in the
> emulator or on my device, even though it looks fine in eclipse. I've been
> trying to design my app to support multiple screens as described in the
> newsreader example on the Android Developers site. I've designed four sets
> of images using the scaling factors of .75 for low density, 1.0 for medium
> (baseline) density and so on. and I have these all in the proper
> directories in my res folder.
>
> Then I created a layout and I'm labeling for normal sized screens and I've
> created an alias for this by creating a values-sw480dp-port folder in my
> res folder and creating a layouts.xml file that references my layout. I
> also have other values-xx-port folders for the different screen sizes using
> both the qualifiers of large, normal, small, etc. and the smallest width
> qualifiers as well.
>
> The code for my layout is the following:
>
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android";
>     android:layout_width="match_parent"
>     android:layout_height="match_parent"
>     android:background="@drawable/bckgnd_home" >
>
>     <fragment android:name="org.wusf.FragmentNavigation"
>         android:id="@+id/navBar"
>         android:layout_width="match_parent"
>         android:layout_height="wrap_content"
>         android:layout_alignParentBottom="true">
>         <!-- Preview: layout=@layout/navigation -->
>     </fragment>
>
>     <TextView
>         android:id="@+id/streamText"
>         android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:layout_above="@id/navBar"
>         android:layout_centerHorizontal="true"
>         android:layout_marginBottom="15dp"
>         android:textColor="#000000"
>         android:text="@string/streamInfo"
>         android:textSize="16sp" />
>
>     <SeekBar
>         android:id="@+id/volumeSlider"
>         android:thumb="@drawable/volume_knob"
>         android:progressDrawable="@drawable/volume_slider"
>         android:layout_width="245dp"
>         android:layout_height="wrap_content"
>         android:layout_centerHorizontal="true"
>         android:layout_above="@id/streamText"
>         android:layout_marginBottom="18dp"
>         android:minHeight="11dp"
>         android:maxHeight="11dp" />
>
>     <org.wusf.MyViewFlipper
>         android:id="@+id/adViewFlipper"
>         android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:layout_centerHorizontal="true"
>         android:layout_above="@id/volumeSlider"
>         android:layout_marginBottom="18dp">
>
>         <ImageView
>             android:id="@+id/image1"
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:src="@drawable/image1"
>             android:contentDescription="@string/adInfo" />
>     </org.wusf.MyViewFlipper>
>
>     <ImageButton
>         android:id="@+id/wusfStreamBtn"
>         android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:layout_centerHorizontal="true"
>         android:layout_marginTop="218dp"
>         android:src="@drawable/button_state_wusf_stream"
>         android:background="@android:color/transparent"
>         android:contentDescription="@string/wusfStreamInfo" />
>
>     <ImageButton
>         android:id="@+id/wsmrStreamBtn"
>         android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:layout_below="@id/wusfStreamBtn"
>         android:layout_alignRight="@id/wusfStreamBtn"
>         android:layout_marginTop="18dp"
>         android:src="@drawable/button_state_wsmr_stream"
>         android:background="@android:color/transparent"
>         android:contentDescription="@string/wsmrStreamInfo" />
>
>     <ImageButton
>         android:id="@+id/infoBtn"
>         android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:layout_alignParentTop="true"
>         android:layout_alignParentRight="true"
>         android:layout_marginTop="10dp"
>         android:layout_marginRight="10dp"
>         android:src="@drawable/btn_info"
>         android:background="@android:color/transparent"
>         android:contentDescription="@string/informationBtn" />
> </RelativeLayout>
>
> You can see how this displays in eclipse by the attached file labeled
> "correct_layout". However when I run this app on my phone it looks like the
> attached file labeled "Screen_capture_messed_up_layout".
>
> My phone is a 4.3 inch screen with a 540x960 resolution with a 240 dpi. My
> phone is also running ICS 4.0.3. This tells me my phone should fall into
> the normal screen/high density category. So by using the layout from the
> values-sw480dp-port should work and it should look pretty similar to what
> eclipse is showing me. Things may be a little off but it should be by that
> much.
>
> I would love to get some input on this issue. After reading the newsreader
> example, using layout aliases seems like a pretty good solution for this
> problem, and I feel like this is harder than it needs to be. However,
> perhaps I'm doing something completely wrong.
>
> Any help that can be provided would be greatly appreciated.
>
> Thanks,
> DanielleM
>
> --
> 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

-- 
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