layoutopt

注意: Android layoutopt 工具已經取代 lint 工具自 SDK 工具修訂版本 16 起開始執行。lint 工具回報 UI 版面配置效能問題的方式與 layoutopt 類似,且會偵測其他問題。

如要進一步瞭解如何使用 lint,請參閱 使用 lint 檢查項目改善程式碼

layoutopt 是一項指令列工具,可協助您最佳化 應用程式的版面配置和版面配置階層本文件提供可用指令列選項的參考資料。

用量

要對指定的版面配置資源清單執行 layoutopt,請執行下列操作:

layoutopt <file_or_directory> ...

例如:

$ layoutopt res/layout-land
$ layoutopt res/layout/main.xml res/layout-land/main.xml