0
Boa I have a Webview that does not want to go to the center of my app
I leave here the example
In my xml :
<WebView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:id="@+id/webView2"
android:background="#f0f0f0" />
my xml :
?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#f0f0f0"
android:orientation="vertical"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="3000dp"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_horizontal"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:cropToPadding="false"
android:layout_gravity="center_horizontal"
android:layout_alignParentTop="true"
android:scaleType="fitXY"
android:id="@+id/imgcabecalho"
/>
<TextView
android:id="@+id/tvinformacoes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="12dp"
android:textStyle="bold"
android:background="#00BFFF"
android:text="nome" />
<TextView
android:id="@+id/tvdescricao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333"
android:textSize="12dp"
android:textStyle="bold"
android:text="nome" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/img1"
/>
<TextView
android:id="@+id/tvdescricao2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333"
android:textSize="12dp"
android:textStyle="bold"
android:text=""
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img2"
android:layout_gravity="center_horizontal"
/>
<TextView
android:id="@+id/tvdescricao3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333"
android:textSize="12dp"
android:textStyle="bold"
android:text=""
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/img3"
/>
<TextView
android:id="@+id/tvdescricao4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333"
android:textSize="12dp"
android:textStyle="bold"
android:text=""
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/img4"
/>
<TextView
android:id="@+id/tvdescricao5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333"
android:textSize="12dp"
android:textStyle="bold"
android:text=""
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/img5"
/>
<TextView
android:id="@+id/tvdescricao6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333"
android:textSize="12dp"
android:textStyle="bold"
android:text=""
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:id="@+id/img6"
/>
<TextView
android:id="@+id/tvdescricao7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="#333"
android:textSize="12dp"
android:textStyle="bold"
android:text=""
/>
<WebView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:id="@+id/webView"
android:background="#f0f0f0" />
<WebView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:id="@+id/webView2"
android:background="#f0f0f0" />
<WebView
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_height="0dp"
android:id="@+id/webView3"
android:background="#f0f0f0" />
<WebView
android:layout_width="350dp"
android:layout_gravity="center_horizontal"
android:layout_height="0dp"
android:id="@+id/webView4"
android:background="#f0f0f0" />
<WebView
android:layout_width="350dp"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:id="@+id/webView5"
android:background="#f0f0f0" />
</LinearLayout>
</ScrollView>
Can anyone tell me why ?
Post your full layout XML please
– Hiago Souza
It would be interesting to pass the entire xml code.
– Thiago Luiz Domacoski
Would you like him to use the whole area? or would there be more composers beside him?
– Thiago Luiz Domacoski
I’ve already edited now I tried using fill_parent and nothing
– Tiago Coelho
The xml code is on top
– Tiago Coelho