Hi mathiastck!
I just want to put a small image in the center of the screen.
I tried to do what you wrote and so I changed my main.xml into:

<?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"
    >
        <ImageView
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:scaleType="CENTER"
           android:src="@drawable/sun"
        />
</LinearLayout>

But the little image still remain at the top-left corner of the
screen!
Any idea?
Thanks



On 11 Giu, 21:35, mathiastck <[EMAIL PROTECTED]> wrote:
> You want to use:
>
> android:scaleType
>
> or:
>
> setScaleType(ImageView.ScaleType)
>
> http://code.google.com/android/reference/android/widget/ImageView.Sca...
>
> You probably want FIT_CENTER or CENTER
>
> On Jun 11, 7:42 am, Alberto <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> > as topic: I wish to center an image in the screen but I don't know how
> > do it!
> > Help me, thanks!
>
> > P.S. Actually my main.xml is this:
>
> > <?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">
> >         <ImageView
> >            android:layout_width="wrap_content"
> >            android:layout_height="wrap_content"
> >            android:src="@drawable/sun"
> >         />
> > </LinearLayout>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to