2017-02-12 88 views
0

從2.0.0-alpha3升級到2.0.0後,我的大部分視圖看起來都傾斜了。這是我正在使用的佈局的XML:從Android Wear 2.0.0-alpha3升級到2.0.0版本打破了我的佈局

<?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> 

如下面的屏幕截圖所示,該按鈕相當傾斜。 Iam不通過代碼進行任何操作。

這是2.0.0-素α3:

enter image description here

這是2.0.0,最終版本: enter image description here

我對LG文雅的第二代LTE測試。

回答

1

這其實是一個錯誤修復是BoxInsetLayout - 之前,您FrameLayoutandroid:padding="5dp"是被忽略(這就是爲什麼「正手」是直接在app:layout_box="all"邊緣的邊緣)。現在,它正在受到尊重,你的整個內部觀點正在被各方所填補,從而導致整體空間減少。

刪除FrameLayout中的android:padding="5dp"應該足以恢復以前的樣子。