I have created a view (actually a webview):
<WebView
android:id="@+id/myWebView"
android:layout_width="match_parent"
android:layout_height="@dimen/input_height"
/>
Which refers to the height in another xml file:
<resources>
<dimen name="key_height">50dip</dimen>
<dimen name="candidate_font_height">16sp</dimen>
<dimen name="candidate_vertical_padding">6sp</dimen>
<dimen name="input_height">280dip</dimen>
</resources>
Where I have set the input_height
as 280dip
which I understand to mean 280 pixels (device independently) of an approximately 320 pixel (or emulated 320ish pixel) height.
On my two devices (small sony ericsson xperia x10 mini with 320 pixel screen, and old htc desire), it works fine, providing a view height of approximately 1.3 of the screen height. One of my testers is using a samsung galaxy S and they are reporting that the view takes up more than the entire screen.
I assume the issue is something to do with screen density, but I thought using dip
would circumvent that issue.
How should I define my layout view to avoid this problem?