如何删除Android Studio中所有配置的未使用字符串资源? [英] How to delete an unused string resource for all configurations in Android Studio?

查看:701
本文介绍了如何删除Android Studio中所有配置的未使用字符串资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个未使用的字符串资源,例如:

I've found an unused string resource, like:

<string name="obsoletestring">my name is null!</string>

但是它以数十种文件,不同语言,在valuesvalues-afvalues-be等文件夹中的不同strings.xml文件中存储.

However it is in tens of files, of different languages, in different strings.xml files in values, values-af, values-be, etc folders.

除了一个接一个地手动修改之外,我肯定已经错过了一些其他方法,不知道该如何在Android Studio中执行此操作.

I must have missed something not to know any way to do this in Android Studio other than modifying it by hand one by one.

tl; dr 如何为所有配置删除未使用的字符串资源?

tl;dr How to delete an unused string resource for all configurations?

推荐答案

现在可以内部 Android Studio. 在检查Lint之后,您会在右侧的删除所有未使用的资源

It is now possible inside Android Studio. After Lint checks you see an option on the right Remove All Unused Resources!

要在所有语言环境文件中删除单个字符串资源,可以使用翻译编辑器". 1.右键单击res目录以打开翻译编辑器. 2.选择显示所有键"选择器,然后选择按文本过滤".提供要删除的资源的名称. 3.选择资源,然后单击-"按钮

To Delete a single string resource across all locale files, you can use the "Translation Editor". 1. Right click on the res directory to open the translation editor. 2. Select "Show All Keys" selector, and choose "Filter by Text". Supply the name of the resource that you want to delete. 3. Select the resource, and click on the "-" button

这篇关于如何删除Android Studio中所有配置的未使用字符串资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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