本文介紹了在 Eclipse 中格式化 XML 代碼的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
當我在 Eclipse 中編寫 .xml 文件時,我經常不得不手動縮進代碼.例如
When I write .xml files in Eclipse, I often have to manually indent code. For example
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
格式化后是這個樣子.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
如何自動化?我在 Eclipse 中找不到 XML 格式設置.
How to automate this? I can't find formatting settings in Eclipse for XML.
推薦答案
Ctrl+Shift+F
會為你做的,你可以在里面配置
Will do it for you, and you can configure it in
Window -> Preferences -> XML -> Xml Files -> Editor
這篇關于在 Eclipse 中格式化 XML 代碼的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!