我是新来的徽章的概念。在我的应用我想显示选项卡上的徽章。对于我所使用的Android的viewbadger.jar文件。它工作正常,但position属性不受影响。如何设置的位置。如果您需要更多信息,请让我知道。
I am new to badge's concept. In my application i want to show the badges on the tabs. For that i used the android-viewbadger.jar file. It's working fine but position property is not effected. How to set the position. If you need more info please let me know.
TabWidget tabs = (TabWidget) findViewById(android.R.id.tabs);
DH_Constant.badgeView = new BadgeView(this, tabs, 2);
// it's working fine
badge1.setBadgePosition(BadgeView.POSITION_CENTER);
// But I Supposed to set it as position to top_left or top_right then it still shows as bottom_left and bottom_right
badge1.setBadgePosition(BadgeView.POSITION_TOP_RIGHT);
DH_Constant.badgeView.setText(DH_Constant.MessagesCount_obj.count);
DH_Constant.badgeView.show();
输出:
默认情况下它的位置是 TOP_RIGHT
。如果你想要任何其他职位,你必须设置。例如对于TOP_LEFT使用:
By default it's position is TOP_RIGHT
. If you want any other position you have to set that.
e.g
For top_left use:
badge1.setBadgePosition(BadgeView.POSITION_TOP_LEFT);
有关中心使用:
badge1.setBadgePosition(BadgeView.POSITION_CENTER);
有关BOTTOM_LEFT使用:
For bottom_left use:
badge1.setBadgePosition(BadgeView.POSITION_BOTTOM_LEFT);
有关BOTTOM_RIGHT使用:
For bottom_right use:
badge1.setBadgePosition(BadgeView.POSITION_BOTTOM_RIGHT);