0

从 2.0.0-alpha3 升级到 2.0.0 后,我的大部分观点看起来都出现了偏差。这是我正在使用的布局的 XML:

<?xml version="1.0" encoding="utf-8"?>
<android.support.wearable.view.BoxInsetLayout
    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:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="oviroa.bestshot.android.StartPlayActivity"
    tools:deviceIds="wear"
    android:padding="15dp">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="5dp"
        app:layout_box="all">
        <TextView
            android:id="@+id/shot_type"
            app:layout_box="all"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/forehand"
            android:theme="@style/BST.HeaderText"/>
        <Button
            android:layout_marginTop="30dp"
            android:layout_marginBottom="0dp"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"
            android:id="@+id/record"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/swoosh_background"
            android:text="@string/record_action"
            android:gravity="center_horizontal|bottom"
            android:textAlignment="center"
            android:paddingBottom="15dp"
            android:theme="@style/BST.ButtonWithIcon.Bold" />
    </FrameLayout>
</android.support.wearable.view.BoxInsetLayout>

正如您在下面的屏幕截图中看到的那样,该按钮相当倾斜。我没有通过代码进行任何操作。

这是 2.0.0-alpha3:

在此处输入图像描述

这是最终版本 2.0.0: 在此处输入图像描述

我正在测试 LG Urbane 第二代 LTE。

4

1 回答 1

1

这实际上是一个错误修复BoxInsetLayout- 之前,android:padding="5dp"您的 onFrameLayout被忽略(这就是为什么“正手”直接位于边缘的app:layout_box="all"边缘)。现在,它得到了尊重,你的整个内部视图都被填充到了各个方面,从而减少了整体空间。

删除android:padding="5dp"你的FrameLayout应该足以恢复以前的外观。

于 2017-02-12T20:16:41.513 回答