Tag:Android
Category:Android第三方
Article From:https://www.cnblogs.com/ganchuanpu/p/6619039.html

BadgeViewThe third party plug-in, used to display the tag on the component, serves as a reminder. The download address is as follows: http://files.cnblogs.com/files/hyyweb/android-viewbadger.zip:

First, import the jar package of BadgeView into the LIBS folder, and then you can use the class library it provides. The core code is as follows:

package com.example.badgeview;

import com.readystatesoftware.viewbadger.BadgeView;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.view.Menu;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button btn=(Button) findViewById(R.id.button1);
        ImageView target= (ImageView )findViewById(R.id.imageView1);
        BadgeView bv = new BadgeView(this, btn);
        bv.setText("1");
        bv.setTextColor(Color.YELLOW);
        bv.setTextSize(12);
        bv.setBadgePosition(BadgeView.POSITION_TOP_RIGHT); //Default value//bv.hide ();Bv.show ();}}

  

Link of this Article: BadgeView use

Leave a Reply

Your email address will not be published. Required fields are marked *