Antilope
Antilope

Reputation: 445

screen resolution and widgets

I set a webview so:

        <WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="500px"
        android:layout_below="@+id/button1"
        android:layout_centerHorizontal="true" />

but is this correct? if the resolution of the Android phone change, I should perhaps give a height in units of percent instead in pixel?

Upvotes: 0

Views: 531

Answers (1)

Raykud
Raykud

Reputation: 2484

I suggest you use DP since it would "fit" into any dimmension. These links could help you: What is the difference between "px", "dp", "dip" and "sp" on Android? and Supporting Multiple Screen Resolutions Android Developers

Upvotes: 3

Related Questions