1

我有一个 16dp 填充的相对布局,其中包含(除其他外)一个具有以下尺寸的按钮:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:padding="16dp">

    <Button
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:text="@string/btn_next"
        android:id="@+id/btn_next"
        style="@style/myStyle"
        android:layout_alignParentBottom="true"/>

</RelativeLayout>

在 nexus 5 上,它按预期显示:它是如何出现在 nexus 5 上的

然而,在三星 Galaxy S5 上,右侧似乎被切断了:它在 S5 上的显示方式

我知道三星喜欢对 Android 做出奇怪的改变,但我认为这不会影响视图的显示方式。还有其他人遇到过这个问题吗?

编辑 1:我已经包含了按钮使用的样式,但是我的应用程序的其他区域也会发生这种情况(例如具有 match_parent 宽度的 TextViews)。

    <style name="myStyle" parent="My.Button">
        <item name="android:textColor">@color/primary_button_text_selector</item>
        <item name="android:background">@drawable/primary_button_selector</item>
    </style>
4

0 回答 0