superM
superM

Reputation: 8695

Android webview zooming in relative layout

I have a RelativeLayout and there is a WebView inside it. After I zoom in and zoom out, my WebView isn't in center. When I include another view into my RelativeLayout I can't place the WebView in center. Can anyone please suggest anything?? any help is appreciated

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fullscreen_image_parrent"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/black">

<WebView 
    android:id="@+id/webview"
    android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true">
</WebView>

<include layout="@layout/full_image_controls"/>    

Upvotes: 1

Views: 980

Answers (1)

Android-Droid
Android-Droid

Reputation: 14585

First of all, you don't need orientation tag in RelativeLayout. And another thing..did you try to set your layout width and height params to fill_parent. I'm not really sure about it,but in some situations I had almost the same problem with alignments on my views just because my RelativeLayout was using wrap_content instead of fill_parent.

Upvotes: 1

Related Questions