Bixby Developer Center

References

layout-macro

optionalvalue required

Defines a layout or a portion of a layout with a macro. You can use this layout macro to define repeatable portions of your layout, such as a card or a cell for a specific structure. You define the exact parameters within a layout macro using a layout-macro-def.

Note

This key will be deprecated in a future release. You should switch to using generic macro and macro-def keys instead to create layout macros. For more information, see Reusing Content with Macros.

Note

Currently, we do not support returning multiple components from a layout-macro. If you want to have multiple components, for example multiple section components, you have to return a full layout.

If you want to define multiple components within a macro, you must use a macro instead.

Note

Be aware of which components you are adding to your layouts and layout macros, because different components are available under different views. If you call a layout or layout macro in a view and that layout specifies a component that the view does not support, Bixby Developer Studio will throw an error. Similarly, you should consider which layout macros are being called within a layout itself. The same layout macro invoked in one component might not be valid if used within a different component, as the list of supported child components could differ.

You can read the Designing with Bixby Views Design Guide and the Building Bixby Views (UI) Developers' Guide to check if your layout is using the correct components for that moment and that view.

Example

            layout-macro (hotel-rating) {
param (rating) {
expression (hotel.rating)
}
param (reviewCount) {
if (exists(hotel.reviewCount)) {
expression (hotel.reviewCount)
}
}
}

View dc922cf on GitHub

Child Keys

param
optional
Parameter to which the argument (specified as a child) should bind