如何实现View上添加标签

效果图:

利用 https://github.com/linger1216/labelview 类库来实现

具体代码 问度娘。

{
LabelView label = new LabelView(this);
label.setText("HD");
label.setBackgroundColor(0xffE91E63);
label.setTargetView(findViewById(R.id.button), 4, LabelView.Gravity.RIGHT_TOP);
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "button click", Toast.LENGTH_SHORT).show();
}
});
}

 

希望通过看大牛的博客对你有较多的收获:

http://blog.csdn.net/nmsoftklb/article/details/46894577

 

同时 做出整理:详情剖析API Demos中的LabelView链接:

http://blog.csdn.net/manymore13/article/details/8769013

posted @ 2015-07-27 00:06  一座城池2012  阅读(318)  评论(0编辑  收藏  举报