Issue
I have a layout where I need to show a webview on part of the screen. I've set the layout up and in the Graphical Layout in Eclipse, it does look as I want to, like this (logo and heading blacked out):
However when I open this layout in the simulator or on a Phone it shows the WebView as a full screen. How do I make a layout like this? Any help is much appreciated!
Here's my XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Theme.KB_default"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/header_background_shape" >
<TextView
android:id="@+id/heading"
style="@style/Theme.KB_header"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:text="@string/app_name" >
</TextView>
<ImageView
android:id="@+id/imageViewPadlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:contentDescription="@string/global_secure_connection"
android:src="@drawable/padlock" />
</RelativeLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@color/black" >
</View>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.41"
android:orientation="vertical" >
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="40dp"
android:layout_height="20dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:contentDescription="@string/global_logo"
android:scaleType="fitXY"
android:src="@drawable/logo_transparrent_notext" />
</LinearLayout>
</LinearLayout>
Solution
Well I seem to be the stupidist guy alive. My layout worked but I forgot to add " setContentView(xml.file);" so it never loaded the XML... Stupid
Answered By - Jacob
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.