Note that there are some explanatory texts on larger screens.

plurals
  1. POscaling in Android
    primarykey
    data
    text
    <p>I have been recently trying to write a layout for android app. At first I debugged it with a real handset and the layout looked ok. However later I tried running it on emulator but on different resolution. Then it doesn't fit in the screen. Width looks fine, but the height not. My handset resolution is 480x800. Could it have anything to do with aspect ratio. I have all my dimensions in dp. Some of the emulator's resolutions look fine, others however don't. Shouldn't Android scale it by it self? </p> <p>Heres the look at the layout file:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;RelativeLayout android:id="@+id/RelativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="0px" android:layout_height="0px" android:focusable="true" android:focusableInTouchMode="true"/&gt; &lt;EditText android:id="@+id/SetAddr" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/StartServer"&gt; &lt;/EditText&gt; &lt;LinearLayout android:orientation="horizontal" android:id="@+id/LinearLayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/SetAddr" android:gravity="center_horizontal"&gt; &lt;Button android:id="@+id/PingStart" android:layout_width="@dimen/StartButtonWidth" android:layout_height="@dimen/StartButtonHeight" android:layout_below="@id/SetAddr" android:text="@string/Start" /&gt; &lt;Button android:id="@+id/PingStop" android:layout_width="@dimen/StopButtonWidth" android:layout_height="@dimen/StopButtonHeight" android:layout_below="@id/SetAddr" android:layout_toRightOf="@id/PingStart" android:text="@string/Stop" /&gt; &lt;/LinearLayout&gt; &lt;TextView android:id="@+id/PingResults" android:layout_width="@dimen/ResultsViewWidth" android:layout_height="@dimen/ResultsViewHeight" android:layout_below="@id/LinearLayout2" android:textColor="#000" android:background="#FFF" android:layout_centerHorizontal="true" android:scrollbars="vertical" /&gt; &lt;LinearLayout android:orientation="horizontal" android:id="@+id/LinearLayout3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/PingResults" android:gravity="center_horizontal"&gt; &lt;Button android:id="@+id/PingStartTrace" android:layout_width="@dimen/OptionButtonWidth" android:layout_height="@dimen/OptionButtonHeight" android:text="@string/Trace" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/PingStartLookup" android:layout_width="@dimen/OptionButtonWidth" android:layout_height="@dimen/OptionButtonHeight" android:layout_toRightOf="@id/PingStartTrace" android:text="@string/Lookup" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/PingStartWebget" android:layout_width="@dimen/OptionButtonWidth" android:layout_height="@dimen/OptionButtonHeight" android:layout_toRightOf="@id/PingStartLookup" android:text="@string/WebGet" &gt; &lt;/Button&gt; &lt;Button android:id="@+id/PingStartOptions" android:layout_width="@dimen/OptionButtonWidth" android:layout_height="@dimen/OptionButtonHeight" android:layout_toRightOf="@id/PingStartWebget" android:text="@string/Options" &gt; &lt;/Button&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>Dimens file:</p> <pre><code>&lt;resources&gt; &lt;dimen name="StartButtonHeight"&gt;50dp&lt;/dimen&gt; &lt;dimen name="StartButtonWidth"&gt;250dp&lt;/dimen&gt; &lt;dimen name="StopButtonHeight"&gt;50dp&lt;/dimen&gt; &lt;dimen name="StopButtonWidth"&gt;60dp&lt;/dimen&gt; &lt;dimen name="ResultsViewWidth"&gt;290dp&lt;/dimen&gt; &lt;dimen name="ResultsViewHeight"&gt;330dp&lt;/dimen&gt; &lt;dimen name="OptionButtonHeight"&gt;50dp&lt;/dimen&gt; &lt;dimen name="OptionButtonWidth"&gt;75dp&lt;/dimen&gt; &lt;/resources&gt; </code></pre> <p>On some resolutions I see only half textview and no buttons below it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload