如何添加字符串资源在Eclipse? [英] How to add string resources in Eclipse?

查看:426
本文介绍了如何添加字符串资源在Eclipse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以让Eclipse加入我的字符串资源为我code或我切换到string.xml所有的时间,并添加每个字符串?

Can I have Eclipse adding my string resources as I code or do I have to switch to string.xml all the time and add each string?

推荐答案

之类的Eclipse会为你做它。所以,如果你有一个字段:

Eclipse will sort of do it for you. So if you have a field:

android:text="hello"

选择你好,然后转到重构 - > Android的 - >提取的Andr​​oid字符串,Eclipse会将该行更改为:

Select "hello" and then goto Refactor-->Android-->Extract Android String, Eclipse will change the line to:

android:text="@string/hello"

和自动的添加行的strings.xml为:

and automagically add the line to strings.xml as:

<string name="hello">Hello</string>

JAL

这篇关于如何添加字符串资源在Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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