I am currently working on an app that displays screen content in HTML format, which is pulled from a database. To ensure compatibility with various devices, I need to use percentages for the width and height of the elements. However, I have been facing issues with getting the height percentage to work properly in any components. I have simplified the layout for troubleshooting purposes and provided the code below. The different background colors assigned to elements help me visualize the impact of code modifications.
In the screenshot accompanying this message, you can see that the yellow background should be showing at 100% height if the code were working correctly. Below is the simplified display code:
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<html lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
*{ margin:0; padding:0;}
html { width:100%; min-height:100%; background:yellow;}
body { width:100%; min-height:100%; background:red;}
</style>
</head>
<body>
<table style="height: 100%; background:white;">
<tr >
<td width="275" height="200" bgcolor="blue"></td>
<td width="275" height="200" bgcolor="brown"></td>
</tr>
<tr>
<td colspan="2" width="450" height="300" bgcolor="green"></td>
</tr>
<tr>
<td colspan="2" width="450" height="300" bgcolor="black"></td>
</tr>
</table>
</body>
</html>
Attached is a screen shot of how the app appears on a Nexus 7:
Any assistance in resolving this issue would be greatly appreciated. Thanks!
Cayce
Here is the Android Project Manifest.XML code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paulistpress.ordo"
android:versionCode="3"
android:versionName="1.3" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:hardwareAccelerated="false"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/AppBaseTheme" >
<activity
android:name="Splash"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="OrdoAppActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" >
</activity>
</application>
</manifest>
>>>>>>>>>>> Two places of WebView codes, as per my notes >>>>>>
<WebView
android:id="@+id/view_about"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="88" />
<WebView
android:id="@+id/view_symbols"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="88" />