硬codeD串QUOT;测试与QUOT ;,应该使用@string资源 [英] Hardcoded string "Test", should use @string resource

查看:195
本文介绍了硬codeD串QUOT;测试与QUOT ;,应该使用@string资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

喜家伙我是新来的,这是我的第一个问题。

Hi guys I'm new here and this is my very first problem

这是我的code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >



<TextView

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/ref"    
 />

<TextView

    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Test"
 />

我不希望使用字符串中的第二个测试我应该怎么办?

I don't want to use string in the second test what should i do ?

推荐答案

这是您正在使用的字符串硬codeD或不是没有问题。
如果您想了解更多信息,你可以看看: http://stackoverflow.com/a/8743887/1517996

No problem that you are using the string hardcoded or not. If you want further information you could look: http://stackoverflow.com/a/8743887/1517996

的strings.xml

strings.xml

<resources>
    <string name="Test">Test</string> 
<resources>

和使用它像

<TextView

    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/Test"
 />

这篇关于硬codeD串QUOT;测试与QUOT ;,应该使用@string资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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