watermark-android

by fulushan

andriod加文字水印 支持配置文字大小,倾斜角度,多行水印。

229 Stars 37 Forks Last release: Not found Apache License 2.0 5 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

android版本水印

==请加star 请加star 请加star 重要的事情说三遍!!!==

特点

支持多行水印,支持自定义角度,支持自定义文字大小。

原理:

使用一个TextView 占据整个页面。在TextView基础上面打水印。

用法:

具体的view在

cn.fulushan.watermark.view.WaterMarkBg.java 

具体的用法

public class MainActivity extends AppCompatActivity {
private TextView bg_tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bg_tv = findViewById(R.id.bg_tv);

SimpleDateFormat createTimeSdf1 = new SimpleDateFormat("yyyy-MM-dd");

List labels = new ArrayList<>(); labels.add("用户名:张三"); labels.add("日期:"+ createTimeSdf1.format(new Date())); labels.add("不可扩散"); bg_tv.setBackgroundDrawable(new WaterMarkBg(MainActivity.this,labels,-30,13));

} }

效果图

image

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.