-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error #11
Comments
@smarthityou 按理只是替换控件,不会有问题,自己分析下,看还改了哪里 |
在SwipeFlingAdapterView中的makeAndAddView中FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) child.getLayoutParams();下面各个获取lp.topMargin + lp.bottomMargin会报空指针 |
@smarthityou 你不是用inflater.inflate(layoutId, parent, false)方法实例化view的吧,导致LayoutParams为空 |
我是在适配器里面用的,但也不至于这样吧。然后我在child.getLayoutParams();下面各个获取lp.topMargin + lp.bottomMargin用了try语句 如果出错就不获取lp.topMargin + lp.bottomMargin然后就不会有问题了 。 |
java.lang.NullPointerException
at com.xiangying.view.custom.swipCard.SwipeFlingAdapterView.makeAndAddView(SwipeFlingAdapterView.java:166)
at com.xiangying.view.custom.swipCard.SwipeFlingAdapterView.layoutChildren(SwipeFlingAdapterView.java:150)
at com.xiangying.view.custom.swipCard.SwipeFlingAdapterView.onLayout(SwipeFlingAdapterView.java:127)
at android.view.View.layout(View.java:14833)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
我是打算把demo中的图片位置换成viewview播放视频 然后出现这个问题了
The text was updated successfully, but these errors were encountered: