Android Nougat PercentRelativeLayout\u marginLeftPercent在某些情况下被忽略

Android Nougat PercentRelativeLayout\u marginLeftPercent在某些情况下被忽略,android,android-layout,android-7.0-nougat,android-percentrelativelayout,Android,Android Layout,Android 7.0 Nougat,Android Percentrelativelayout,下面的牛轧糖xml忽略了边际收益率 <?xml version="1.0" encoding="utf-8"?> <android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/containe

下面的牛轧糖xml忽略了边际收益率

<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"       
android:layout_width="match_parent" 
android:layout_height="match_parent">

<TextView
    android:id="@+id/inBoxButton"
    app:layout_widthPercent="20%"
    app:layout_marginLeftPercent="30%"
    app:layout_marginTopPercent="2%"
    android:layout_height="40dp"
    android:text="Inbox"
    android:textSize="18sp"
    android:tag="1"
    android:lines="1"
    android:gravity="center"
    android:textColor="@color/black_color"
    />


我在我的应用程序中还有其他地方不被忽略,但这些地方没有布局。这在6.0中运行良好,但我认为这是7.0中的一个bug

我发现了问题,大部分是我的。我的JAVA扩展了ViewGroup。它应该已经扩展了PercentRelativeLayout。有趣的是,有些PercentRelativeLayout术语(percentWidth)仍然有效,这可能仍然是一个bug。这一切一直持续到7.0。应该扩展PercentRelativeLayout。