try changing the layout to table layout and use gravity arrtibute for the
view in each row...
it worked for me....

On Mon, Jun 1, 2009 at 5:39 PM, iDeveloper <ideveloper...@gmail.com> wrote:

> Hi
> I have a list, a web view and certain buttons on my activity's layout.
> I am trying to center the web view in the layout. The layout_gravity
> attribute that I use for the webview doesn't seem to work. It stays put
> aligned to the left of the screen when I view the activity.
>
> Can someone please tell me how I can center the web view? Thanks.
>
> This is the XML I am using
>
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout
> android:layout_width="fill_parent"
> android:layout_height="fill_parent"
> xmlns:android="http://schemas.android.com/apk/res/android";
> >
>
> <ListView
> android:id="@+id/SCHEDULE"
> android:layout_width="fill_parent"
> android:layout_height="200px"
> android:layout_marginTop="1px"
> android:layout_below="@id/text">
> </ListView>
>
> <WebView
> android:id="@+id/MYVIEW"
> android:layout_width="175px"
> android:layout_height="130px"
> android:layout_below="@id/SCHEDULE"
> android:layout_marginTop="15px"
> android:layout_gravity="center_horizontal"
> >
> </WebView>
> <Button
> android:id="@+id/updatebtn"
> android:layout_width="70px"
> android:layout_height="36px"
> android:text="Update Now"
> android:textSize="14sp"
> android:textColor="#ff000000"
> android:layout_marginTop="15px"
> android:layout_below ="@id/RIDERMAP"
> />
> </RelativeLayout>
>
>
>
> >
>

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

Reply via email to