开发者

Android webview zooming in relative layout

开发者 https://www.devze.com 2023-03-20 13:53 出处:网络
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 ce

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"
androi开发者_StackOverflow中文版d: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"/>    


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消