Android Studio解决办法:
File > Settings > Code Style > XML > Set from > Predefined Style > Android
勾上File > Settings > Editor > Formatting > Show “Reformat Code” 选项
在XML处格式化代码(默认快捷键是CTRL+ALT+L ,Eclipse是:CTRL+ALT+F)
在弹出 的对话框中勾上Rearrange entries 选项
File > Settings > Code Style > XML > Set from > Predefined Style > Android
勾上File > Settings > Editor > Formatting > Show “Reformat Code” 选项
在XML处格式化代码(默认快捷键是CTRL+ALT+L ,Eclipse是:CTRL+ALT+F)
在弹出 的对话框中勾上Rearrange entries 选项