DevEco Studio provides bidirectional preview between the UI preview pages and source code files in .ets format. To enable bidirectional preview, click the icon on the menu bar.
Bidirectional preview is not supported for service widgets.
When this feature is enabled, the code editor, UI, and component tree become interconnected:
When a component on the UI is selected, the corresponding component in the component tree is selected, and the matching code block in the layout file within the code editor is highlighted.
When a code block in the layout file is selected, the corresponding component is highlighted on the UI, and the matching node in the component tree is marked as selected.
When a component in the component tree is selected, both the corresponding code block and the UI component are highlighted.
With the Previewer, you can modify component attributes or styles on the attribute panel. Saving your modifications will automatically update your source code in the code editor and refresh the UI in real time. Similarly, saving your modifications in source code editor will update the UI, component tree, as well as component attributes in real time.
If there is data binding in a component, its attributes cannot be modified from the attribute panel.
If a component involves animations, its attributes cannot be modified from the attribute panel.
Bidirectional preview is not supported during multi-device preview.