StackLayout
or GridLayout
are commonly used, but not best practice. Nesting many StackLayout
or GridLayout
will slow the performance of your app, so use them sparingly. Use Label
more often. Also, a handy tip is using FormattedString
for nesting some paired elements.
Example:
<Button class="-primary p-8">
<FormattedString>
<Span text="" class="fas t-18"></Span>
<Span text=" Different " color="red"></Span>
<Span text="colors in "></Span>
<Span text=" Button " backgroundColor="green" color="whitesmoke"></Span>
</FormattedString>
</Button>
https://docs.nativescript.org/angular/ui/ng-components/formatted-string