Android Snackbar<;合并>;错误
我试图在我的活动中展示snackbar,但膨胀的异常不断地折磨着我。在我的项目的早期阶段,我可以让它工作,稍后;我在我的活动中添加了片段,从那时起我就产生了膨胀异常 守则:Android Snackbar<;合并>;错误,android,xamarin,xamarin.android,android-snackbar,Android,Xamarin,Xamarin.android,Android Snackbar,我试图在我的活动中展示snackbar,但膨胀的异常不断地折磨着我。在我的项目的早期阶段,我可以让它工作,稍后;我在我的活动中添加了片段,从那时起我就产生了膨胀异常 守则: Snackbar.Make(DrawerLayout, "Message", Snackbar.LengthLong).Show(); DrawerLayout是我的活动的根视图,如下所示: <android.support.v4.widget.DrawerLayout xmlns:android="http://s
Snackbar.Make(DrawerLayout, "Message", Snackbar.LengthLong).Show();
DrawerLayout
是我的活动的根视图,如下所示:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/DrawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/ToolbarLayout">
<include
layout="@layout/Toolbar"
app:layout_scrollFlags="scroll|enterAlways" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/ContentFrame"
android:layout_below="@id/ToolbarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<FrameLayout
android:id="@+id/LeftDrawer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start" />
</android.support.v4.widget.DrawerLayout>
我检查以下内容:
theme.AppCompat.Light.NoActionBar
Window.DecorView.RootView
和FindViewById(Android.Resource.Id.Content)
而不是DrawerLayout
它不起作用我发现了一些奇怪的事情:如果我使用Debug运行应用程序,我会得到错误,如果正常运行应用程序(没有附加调试器),snackbar就可以正常工作 使其显示在
ContentFrame
上,而不是Drawerlayout
Snackbar.Make(contentFrame, "Message", Snackbar.LengthLong).Show();
不要忘记首先将视图ContentFrame
绑定到变量ContentFrame
使其显示在
ContentFrame
上,而不是Drawerlayout
Snackbar.Make(contentFrame, "Message", Snackbar.LengthLong).Show();
不要忘记首先将视图ContentFrame
绑定到变量ContentFrame
当调试器未连接时,它会工作,这很奇怪,不是吗?太奇怪了!,你可以随时发布新的question@sinanyil如果答案解决了问题,请接受。谢谢你的回答,但它不能解决我的问题。实际上这个问题还没有解决。然而现在我知道它何时发生,何时不发生。你们有两个不同的问题,这个问题正如你们所说的,由答案来解决!正如我所说的,你可以为你的新问题发布一个新问题。好吧,当调试器没有连接时,它会工作,这很奇怪,不是吗?这太奇怪了!,你可以随时发布新的question@sinanyil如果答案解决了问题,请接受。谢谢你的回答,但它不能解决我的问题。实际上这个问题还没有解决。然而现在我知道它何时发生,何时不发生。你们有两个不同的问题,这个问题正如你们所说的,由答案来解决!正如我所说的,你可以针对你的新问题发布一个新问题。这发生在我将支持库更新到27.1.0之后。显然,合并后的未编译资源目录包含错误版本的design_layout_snackbar_include.xml,这是在我将support library更新到27.1.0后启动的。显然,合并的未编译资源目录的design\u layout\u snackbar\u include.xml版本错误,该版本由启动