MagicaSakura icon indicating copy to clipboard operation
MagicaSakura copied to clipboard

dataBinding在布局添加TintToolbar运行报错

Open NeVaDaAAA opened this issue 6 years ago • 3 comments

XML:

<data>

    <variable
        name="viewModel"
        type="com.ani.dylan.peony.module.home.vm.MainViewModel" />
</data>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">


    <com.bilibili.magicasakura.widgets.TintToolbar
        android:id="@+id/main_toolbar"
        style="@style/Widget.App.Toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/theme_color_primary"
        android:elevation="@dimen/dp_4"
        android:fitsSystemWindows="true"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

    <com.ani.dylan.peony.view.CustomViewPager
        android:id="@+id/main_vp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/main_tab"
        android:layout_below="@+id/main_toolbar" />


    <me.majiajie.pagerbottomtabstrip.PageNavigationView
        android:id="@+id/main_tab"
        android:layout_width="match_parent"
        android:layout_height="55dp"
        android:layout_alignParentBottom="true"
        android:background="@color/white" />

</RelativeLayout>

报错信息: Caused by: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class com.bilibili.magicasakura.widgets.TintToolbar Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class com.bilibili.magicasakura.widgets.TintToolbar

换成V7自带的Toolbar就没有问题。 求各位大佬帮忙看看 感激不禁

NeVaDaAAA avatar Oct 12 '18 02:10 NeVaDaAAA

机型:OnePlus3 Android版本:8.0.0

项目版本: compileSdkVersion: 28, buildToolsVersion: "28.0.2", applicationId : "com.ani.dylan.peony", minSdkVersion : 21, targetSdkVersion : 28, versionCode : 1, versionName : "1.0",

NeVaDaAAA avatar Oct 12 '18 02:10 NeVaDaAAA

遇到了相同的问题

JChunyu avatar Oct 14 '18 09:10 JChunyu

建议暂时先换到0.1.8版本(compile 'com.bilibili:magicasakura:0.1.8@aar'),亲测无此问题

fg2q1q3q avatar Jan 18 '19 09:01 fg2q1q3q