Skip to content
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

Caused by: java.lang.IllegalStateException: only support Gravity.START | Gravity.TOP , Gravity.END | Gravity.TOP , Gravity.START | Gravity.BOTTOM , Gravity.END | Gravity.BOTTOM , Gravity.CENTER , Gravity.CENTER | Gravity.TOP , Gravity.CENTER | Gravity.BOTTOM ,Gravity.CENTER | Gravity.START , Gravity.CENTER | Gravity.END #87

Open
princealirehman1 opened this issue Apr 16, 2019 · 3 comments

Comments

@princealirehman1
Copy link

This is my code:

    badge = new QBadgeView(getContext()).bindTarget(getRightTopBarButton()).setBadgeNumber(0).setBadgeGravity(Gravity.START);


 Caused by: java.lang.IllegalStateException: only support Gravity.START | Gravity.TOP , Gravity.END | Gravity.TOP , Gravity.START | Gravity.BOTTOM , Gravity.END | Gravity.BOTTOM , Gravity.CENTER , Gravity.CENTER | Gravity.TOP , Gravity.CENTER | Gravity.BOTTOM ,Gravity.CENTER | Gravity.START , Gravity.CENTER | Gravity.END
@SuperZiLu
Copy link

你这个应该是要改成
badge = new QBadgeView(getContext()).bindTarget(getRightTopBarButton()).setBadgeNumber(0).setBadgeGravity(Gravity.START | Gravity.TOP);
而我就比较悲剧了
我用kotlin Gravity.START | Gravity.TOP 这样写就报错 难受的一比

@Jay-huangjie
Copy link

@SuperZiLu kotlin 需要用 and 关键字拼接起来

@SuperZiLu
Copy link

@Jay-huangjie 是的 多谢老哥 我也刚开始用kotlin 不太熟 也是第二天自己看文档才发现的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants