【发布时间】:2011-04-22 12:46:29
【问题描述】:
我正在尝试在“关于”框中添加指向 Twitter 个人资料的链接。电子邮件地址和网址等“常规”链接由
android:autoLink="email|web"
在 about.xml 中,但对于 Twitter 个人资料页面,我需要在我的 strings.xml 中使用 html 代码。我试过了:
<string name="twitter">Follow us on <a href=\"http://www.twitter.com/mytwitterprofile">Twitter: @mytwitterprofile</a></string>
在 about 框上呈现 html 标记。
我也试过了:
<string name="twitter">Follow us on <a href="http://www.twitter.com/mytwitterprofile">Twitter: @mytwitterprofile</a></string>
显示文本“在 Twitter 上关注我们:@mytwitterprofile”,但它不是超链接。
我该怎么做这个看似简单的任务!?
干杯, 巴里
【问题讨论】:
-
如何将字符串添加到您的盒子中?
-
看看你是否觉得这篇文章有用 - stackoverflow.com/questions/1997328/…
-
TextView textView = (TextView) findViewById(R.id.about_content); textView.setTextColor(Color.WHITE); textView.setText(getString(R.string.about_text, getString(R.string.twitter), getString(R.string.email_address), getString(R.string.website)));