如何在 Android SDK 的 eclipse 中关闭 @string 资源的警告
我知道“从技术上讲”,对字符串进行硬编码并不是最佳实践;但我可以稍后处理它 - 现在我只想完成我的项目的外壳,并且我对代码中的警告非常强迫 - 有什么方法可以关闭它吗?
如果我的标题不够具体,请以此为例:
<Button android:id="@+id/aboutBtn"
style="@style/DashboardButton"
android:textColor="#ffffff"
android:text="About Vezign"
android:onClick="aboutClick"
android:drawableTop="@drawable/about_icon" />
android:text="" 行将被标记为不使用 strings.xml 并引用它的警告。
最好是能够将其关闭以供将来参考的东西;而不是我需要输入的内容(例如@Suppress警告)
谢谢!
I know it's 'technically' not the best practice to be hard coding strings; but I can deal with it later - right now I just want to get the shell of my projects finished and I'm incredibly OCD about warnings in my code - is there any way to turn this off?
If my title wasn't specific enough take this as an example:
<Button android:id="@+id/aboutBtn"
style="@style/DashboardButton"
android:textColor="#ffffff"
android:text="About Vezign"
android:onClick="aboutClick"
android:drawableTop="@drawable/about_icon" />
The android:text="" line would be flagged as a warning for not using strings.xml and referencing it as such.
Preferably something that would turn it off for all future references; and not something I need to type (e.g. @Suppress Warnings)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
向下滚动到国际化,
将“硬编码文本”的严重性更改为“信息”或“忽略”
Scroll down to internationalization
change the severity of "HardcodedText" to 'information' or 'ignore'