在Android初级教程(五)我们写了HelloAndroid 之后,一直觉得没有写半行代码对不起自己,所以本节,我们将在HelloAndroid 基础之上,进行与TextView 文字标签的第一次接触.在此例中,将会在Layout 中创建TextView 对象,并学会定义res/values/string.xml 里的字符串常数,最后通过TextView 的setText 方法,在预加载程序之初,更改TextView 文字.
首先看一下运行结果如下图:
首先"欢迎来到魏祝林的博客"这几个字是从什么地方来的呢,我们是在res->values->string.xml里面加了如下一句(黑体):
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, HelloAndroid!</string>
<string name="app_name">HelloAndroid</string>
<string name="textView_text