Android中的strings.xml文件中使用HREF [英] Using HREF in Android strings.xml file

查看:580
本文介绍了Android中的strings.xml文件中使用HREF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从分配为一个TextView的android的strings.xml档案下面的字符串:text属性。我无法得到的链接显示为一个可点击的超链接。有什么建议么?我试过以下的技术。

 <字符串名称=no_device_body>点击下面的链接:< [CDATA [< A HREF =htt​​p://cnn.com>链接1< / A>]]>
 < /串> <字符串名称=no_device_body>点击以下链接:http://cnn.com>
 < /串>


解决方案

显示TextView的什么,当你使用第二个字符串呢?就在URL,但无法点击?

你有

 的android:自动链接=网

 的android:自动链接=所有

在布局xml文件你的TextView设置?

I'm trying to assign the below string from the strings.xml file for a TextView android:text property. I'm unable to get the link to show up as a clickable hyperlink. Any suggestions? I've tried the below techniques.

 <string name="no_device_body">click following link: <![CDATA[<a href="http://cnn.com">link1</a>]]>
 </string>

 <string name="no_device_body">click following link: http://cnn.com">
 </string>

解决方案

What shows in the textview when you use the second string there? Just the URL but not clickable?

Do you have

android:autoLink="web"

or

android:autoLink="all"

set on your TextView in the layout xml file?

这篇关于Android中的strings.xml文件中使用HREF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆