簡體   English   中英

Android:屏幕布局在相同型號的2部手機上看起來有所不同

[英]Android: Screen Layout looks different on 2 phones of the same model

我正在對一個應用進行Alpha測試,因此人們第一次在多種設備上查看它。 有人告訴我,他屏幕上的按鈕已被切斷。

奇怪的是-我們正在使用相同的設備。 我們都使用三星Galaxy S3,因此我們的屏幕分辨率應該相同。

  1. 他(或我)的手機上是否有一些設置可以更改分辨率以查看更大的尺寸? (如瀏覽器中的Ctrl +)
  2. 還有什么可能導致這個?

屏幕截圖和XML包含在下面。 右邊的區別:文本較大,缺少自制省略號,“設置”按鈕已關閉

好截圖截圖錯誤

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.farmsoft.lunchguru.app.Pick_Restaurant"
    android:layout_height="match_parent"
    android:layout_width="match_parent">
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:orientation="vertical">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/PickRest_Header"
        android:textStyle="bold"
        android:textSize="20sp"
        android:gravity="center_horizontal"
        android:id="@+id/Lbl_Title"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/PickRest_CompanionHdr"/>

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/Companion_Box">

    </TableLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:orientation="horizontal">

        <Button
            android:layout_width="45dp"
            android:layout_height="30dp"
            android:text="•••"
            android:gravity="top"
            android:id="@+id/More_Companions"
            android:onClick="onClick_More_Companions"/>

        </LinearLayout>

    <Space
        android:layout_width="0dip"
        android:layout_height="35dp" />

    <com.farmsoft.lunchguru.utils.ListButton
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/PickRest_Recommend_Button"
        android:id="@+id/Recommend_Button"
        android:onClick="onClick_Recommend"
        android:enabled="false"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/OR"
        android:gravity="center_horizontal"
        android:textSize="10pt"
        android:textStyle="bold"/>

    <com.farmsoft.lunchguru.utils.ListButton
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/PickRest_Nearby_Button"
        android:id="@+id/Nearby_Button"
        android:onClick="onClick_Nearby"
        android:enabled="false"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/OR"
        android:gravity="center_horizontal"
        android:textSize="10pt"
        android:textStyle="bold"/>

    <com.farmsoft.lunchguru.utils.ListButton
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/PickRest_Search_Button"
        android:id="@+id/Search_Button"
        android:onClick="onClick_Search"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/Lbl_Version"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/Lbl_Coordinates"
        android:text="@string/PickRest_Coordinates_Load"/>

    <Space
        android:layout_width="0dip"
        android:layout_height="35dp" />

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/PickRest_IAteThere_Button"
        android:id="@+id/Attend_Button"
        android:onClick="onClick_Attend"
        android:visibility="gone"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/Ratings_Button"
            android:text="@string/PickRest_Rating_Button"
            android:onClick="onClick_Ratings"
            android:enabled="false"/>
        <Space
            android:layout_width="0dp"
            android:layout_height="0dip"
            android:layout_weight="1" />
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/Settings_Button"
            android:text="@string/PickRest_Settings_Button"
            android:onClick="onClick_Settings"/>
        </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/Connections_Button"
            android:text="@string/PickRest_Connections_Button"
            android:onClick="onClick_Connections"/>

        <Space
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>
        </LinearLayout>
</LinearLayout>
</ScrollView>

通過使用sp指定字體大小,您可以正確完成所有操作。 這將根據系統范圍的字體縮放比例縮放您選擇的字體。 一位用戶增加了系統范圍的字體大小。 在AOSP電話上,這位於“設置/顯示/字體大小”中。 對於三星設備,應該處於類似位置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM