首页 > 解决方案 > 如何修复安卓手机的屏幕尺寸?

问题描述

我的应用程序在我的 LGG4 手机上正确运行,屏幕尺寸正确。但其他设备,例如三星 Galaxy Note 粉丝手机,屏幕有很多空白处。我该如何解决?我更改了mpi, xhdpi,... 文件夹。这是我的content_main xml:(也许是那个代码)

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity"
    tools:layout_editor_absoluteY="81dp"
    tools:showIn="@layout/activity_main">

    <RelativeLayout
        android:id="@+id/mainLayout"
        android:layout_width="410dp"
        android:layout_height="670dp">

    </RelativeLayout>

</RelativeLayout>

标签: androidxml

解决方案


推荐阅读