Android:在 Eclipse 中重构 XML 文件?
在针对 Android 进行开发时,是否有一种方法可以轻松地在 Eclipse 中重命名 XML 文件,以便这些更改反映在源代码中?
在包视图中右键单击该文件并选择 refactor->rename 可更改文件的名称,但不会更改 .java 源文件中对该文件的引用。
Is there a way to easily rename XML files in Eclipse while developing for Android so that these changes are reflected in source code?
Right-clicking on the file in package view and selecting refactor->rename changes the file's name, but does not alter references to the file within the .java source files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我意识到这是一篇旧帖子,但我试图做同样的事情,只是在 Eclipse 中想出了一个解决方案:
搜索 ->文件搜索->替换...
替换:Current.Style.Name
为:New.Style.Name
就是这样!很好很简单,我不想处理进入所有 xml 布局并更改它们的麻烦。
I realise this is an old post, but i was trying to do the same and just came up with a solution to this in eclipse:
Search -> File Search -> Replace...
Replace:Current.Style.Name
With: New.Style.Name
Thats it! Nice and easy, i didn't want to deal with the hassle of going into all my xml layouts and changing them.
我认为 Android 资源目录不存在这样的东西,更不用说布局了。您必须手动更改参考。
I do not think such a thing exists for Android resources directory let alone layouts. You have to change the references manually.