Need help with watermark-android?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

fulushan
244 Stars 37 Forks Apache License 2.0 5 Commits 4 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

# 318,146
Java
5 commits

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.