Jude95 / SwipeBackHelper

make your activity can swipe to close
1.38k stars 268 forks source link

java.lang.ClassCastException: android.view.View cannot be cast to android.view.ViewGroup #24

Closed BochengLiu closed 8 years ago

BochengLiu commented 8 years ago

和demo一样配置 @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); SwipeBackHelper.onPostCreate(this); } 产生了这个错误 Caused by: java.lang.ClassCastException: android.view.View cannot be cast to android.view.ViewGroup at com.jude.swipbackhelper.SwipeBackLayout.attachToActivity(SwipeBackLayout.java:331) at com.jude.swipbackhelper.SwipeBackPage.onPostCreate(SwipeBackPage.java:30) at com.jude.swipbackhelper.SwipeBackHelper.onPostCreate(SwipeBackHelper.java:42) at com.example.ui.base.BaseActivity.onPostCreate(BaseActivity.java:165) 求助

Jude95 commented 8 years ago

...为什么不是ViewGroup。你是不是还用了其他的库往DecorView下加了奇怪的东西。 你试试demo有没有问题。

BochengLiu commented 8 years ago

嗯。我用的bottom-navigation-bar做的底部导航 这个问题要怎么解决呢

Jude95 commented 8 years ago

你用的是这个库?https://github.com/RoyWallace/BottomNavigationBar 它好像并没有动DecorView。 你先看看你的视图结构对不对(从decorview遍历一遍看看吧),谁动了。我再看看怎么兼容一下他们。

BochengLiu commented 8 years ago

找到了 用的SystemBarTintManager做状态栏 这个搞的鬼

Jude95 commented 8 years ago

3.0.2 试试还有没有问题。

BochengLiu commented 8 years ago

嗯 没有问题