-
Notifications
You must be signed in to change notification settings - Fork 534
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
在fragment中绑定button报错 #6
Comments
您能贴全一点的log么,单看这个不知道怎么回事 |
Badge和TargetView绑定是采用的换掉TargetView的Parent实现的,绑定后给此Parent设置了和TargetView同样的id,这时通过findViewById找出来的是TargetView的Parent,如果您需要获得TargetView的对象,可以用此Parent再次findViewById,或者Badge.getTargetView来获得,已在1.0.5版本中添加此方法,感谢您的反馈 |
那我该怎么使用来解决这个闪退问题呢? |
如果尚未绑定,使用findViewById,已绑定使用Badge.getTargetView |
能麻烦你在demo上写个例子吗?我没太明白你表达的 我现在在fragment中先初始化了button 然后把button绑定了 你的意思是在绑定后给badview设置属性时需要使用Badge.getTargetView是这样吗? |
可否把你出错的initViews 151行这附近的代码贴出来,我看下怎么改,不方便在这贴可以发到我的邮箱qstumn@163.com |
你的initViews除了在onCreateView方法中调用之外,是否在其他地方又调用了 |
您可以看下此方法是否被回调了不止一次,如果是这样,建议152行改为 |
确实是回调了两次 我把这个改了 现在回调一次后就正常了,谢谢了 |
BadgeView和TargetView绑定是采用的换掉TargetView的Parent实现的,暂时我没有更完美的解决方法,感谢你的反馈提醒,如果您找到更好的方法并愿意分享希望到时能告诉我 |
好的 谢谢你了,我close了 |
The text was updated successfully, but these errors were encountered: