超链接

java代码


tv01 = (TextView)findViewById(R.id.tv01);
tv01.setTextColor(Color.RED);
tv01.serTextSize(22f);

//html字符:超链接
String htmlhref = "<a href=\"http:www.google.com.hk\">百度</a>";
//Html.fromHtml解析HTML,生成String
tv01.setText(Html.fromHtml(htmlhref));
//html字符:只显示超链接,不使用
//tv01.setAutoLinkMask(Linkify.All);
//除了显示还可以点击
tv01.setMovementMethod(LinkMovementMethod.getInstance());

et01 = (EditText)findViewById(R.id.editText1);
//让EditText显示为密码框输入
et01.setTransformationMethod(PasswordTransformationMethod.getInstance());
//只显示一行,但内容可以是多行
et01.setLines(1);
//将输入框的内容作为一行显示,一直是一行
et01.setTransformationMethod(SingleLineTransformationMethod.getIntence());
//可以输入的最大长度
et01.setFilters(new InputFilter[]{new InputFilter.LengthFilter(10)}));
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值