Bixby Developer Center

Guides

layout-macro

optionalmultiple allowedvalue 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. For more information, see Layout 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.

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) developer guide to check if your layout is using the correct components for that moment and that view.

Example

// Part of the resources/base/layouts/Details/Hotel_Details.layout.bxb file
...
layout-macro (hotel-rating) {
param (rating) {
expression (hotel.rating)
}
param (reviewCount) {
expression (hotel.reviewCount)
}
}
...

Child Keys

select-button-text
required
Selection button text
param
optional
Parameter to which the argument (specified as a child) should bind