Android TextView : “Do not concatenate text displayed with setText”
参考:http://stackoverflow.com/questions/33164886/android-textview-do-not-concatenate-text-displayed-with-settext
在Activity中对TextView进行动态更新显示数据时,如果使用:
RGB_textview.setText(settingData.Image_R + "," + settingData.Image_G + "," + settingData.Image_B);
则Android Studio 会提示:“Do not concatenate text displayed with setText,use resource string with placeholders”,
应改为:
RGB_textview.setText(getString(R.string.RGB_value_string, settingData.Image_R, settingData.Image_G, settingData.Image_B));
<string name="RGB_value_string">%1$d,%2$d,%3$d</string>
不修改也能正常运行,但修改一下会更加规范。
Android TextView : “Do not concatenate text displayed with setText”的更多相关文章
- Android,TextView的所有属性和方法
XML 属性 属性名称 相关方法 描述 android:autoLink setAutoLinkMask(int) 设置是否当文本为URL链接/email/电话号码/map时,文本显示为可点击的链接. ...
- Android TextView 添加下划线的几种方式
总结起来大概有5种做法: 1. 将要处理的文字写到一个资源文件,如string.xml(使用html用法格式化) 2. 当文字中出现URL.E-mail.电话号码等的时候,可以将TextView ...
- Android TextView图文混合编排
Android TextView图文混合编排 实现技术细节不难,两个要点:1.html代码的混合编写.2,重写ImageGetter.例如:布局: <?xml version="1.0 ...
- Android:TextView 自动滚动(跑马灯) (转)
Android:TextView 自动滚动(跑马灯) TextView实现文字滚动需要以下几个要点: 1.文字长度长于可显示范围:android:singleLine="true ...
- android TextView多行文本(超过3行)使用ellipsize属性无效问题的解决方法
这篇文章介绍了android TextView多行文本(超过3行)使用ellipsize属性无效问题的解决方法,有需要的朋友可以参考一下 布局文件中的TextView属性 复制代码代码如下: < ...
- How to easily concatenate text based on criteria in Excel? 如何将Excel中的文本按条件合并
To combine text with the unique ID numbers, you can extract the unique values first and then create ...
- Android TextView中有图片有文字混合排列
Android TextView中有图片有文字混合排列 1.使用html.fromHtml 2.新建ImageGetter 3.使用<img src>标签 demo: 1.设置文字 ((T ...
- Android:TextView跑马灯-详解
Android:TextView跑马灯_详解 引言: TextView之所以需要跑马灯,是由于文字太长,或者是吸引眼球. 关键代码如下: android:singleLine="true&q ...
- android textView 折叠 展开 ExpandableTextView
项目过程中可能会用到可以折叠和展开的TextView , 这里给出一种实现思路,自定义控件. package com.example.expandtextviewdemo; import androi ...
随机推荐
- linux进程与端口查看命令
查看程序对应进程号:ps –ef|grep 进程名 查看进程号所占用的端口号:netstat –nltp|grep 进程号 使用lsof命令: lsof –i:端口号
- [翻译][MVC 5 + EF 6] 2:基础的增删改查(CRUD)
原文:Implementing Basic CRUD Functionality with the Entity Framework in ASP.NET MVC Application 1.修改Vi ...
- As3 里的正则相关
用正则的时候 不要用if(content.match("test").length > 0) ...; 改成 if(content.match(/test/g).length ...
- mysql主从 1050错误
在mysql从库上查询时出现如下错误 ...................... Last_Errno: 1050 Last_Error: Error 'Tab ...
- PHP生成制作验证码
看完就会,不会你打我,话不多说.开搞(人狠话不多) 1.0 首先先看代码 <?php header("Content-Type:text/html;Charset=UTF-8" ...
- 用Eclipse 开发Dynamic Web Project应用程序 【转】
简介:本文仅简单介绍基于Eclipse开发Dynamic Web Project应用下的JSP,Servlet及TOMCAT数据源的配置和开发. 软件环境: Eclipse Java EE IDE f ...
- 隐私:网民最常用密码MD5解密
国内知名网络安全商瑞星公司曾发布过一项针对密码强度的专业研究报告,这项研究中列举了中国网民和美国网民最常用的密码集.研究表明,全球互联网大部分用户在密码使用中都存在着种种疏漏,一些极其简单的密码被广泛 ...
- xcode升级后, 插件失效修复
1. 首先查看 Xcode 的 UUID,在终端执行 defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilit ...
- memcached-win32-1.4.4-14 help doc
memcached-win32-1.4.4-14 cmd打开命令窗口,转到解压的目录,输入 “memcached.exe -d install”. 使用telnet命令 验证缓存服务器是否可用.tel ...
- ANDROID_MARS学习笔记_S04_003_用HttpClent发http请求
一.代码 1.xml(1)activity_main.xml <TextView android:layout_width="wrap_content" android:la ...