question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More than one layout child inside a ContentView [IOS] [tns-core-modules 4.0.0]

See original GitHub issue

From @pvcoelho on January 26, 2018 12:10

Having inside the component’s .html file both RadSideDrawer and GridLayout elements, when trying to run the app in IOS, it fails with the following error: More than one layout child inside a ContentView Although in Android everything runs fine.

  • Progress NativeScript UI version: “^3.2.0”
  • CLI: 4.0.0-2018-01-15-10407
  • Cross-platform modules: “^4.0.0-2018-01-08-02”
  • Runtime(s): "tns-ios": “4.0.0-2018-01-17-01”

Code files:

items.component.html:

items.component.html.txt

items.component.ts:

items.component.ts.txt

Copied from original issue: telerik/nativescript-ui-feedback#503

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pvcoelhocommented, Jan 29, 2018

Problem solved:

I’ve moved the content of the GridLayout/ListView inside the RadSideDrawer with the tag tkMainContent (after the menu declaration):

<ActionBar class="action-bar-custom">
    <GridLayout rows="auto,*">
        <GridLayout row="0" columns="20, 30, *">
            <Label col=0 text=""></Label>
            <Label col="1" class="mdi-actionitem mdi-menu" [text]="'mdi-menu' | fonticon" (tap)="openDrawer()"></Label>

        </GridLayout>
    </GridLayout>
</ActionBar>

<RadSideDrawer #sidedrawerId showOverNavigation="false" tkExampleTitle tkToggleNavButton>
    <StackLayout tkDrawerContent class="sideStackLayout">
        <StackLayout class="sideTitleStackLayout">
            <Image src="res://logo_login2" stretch="none"></Image>
        </StackLayout>

        <GridLayout class="sideStackLayout" rows="auto, auto, auto, auto, auto, auto, auto, auto, auto, *">

            <GridLayout row="0" columns="50, *" class="sideOptions menu-top-border" [nsRouterLink]="['/ondeestamos']" nsRouterLinkActive="active">
                <Label class="mdi" [text]="'mdi-map-marker-radius' | fonticon"></Label>
                <Label col="1" text="Onde estamos" class="sideLabel"></Label>
            </GridLayout>

            <GridLayout row="1" columns="50, *" class="sideOptions menu-top-border" [nsRouterLink]="['/dadospessoais']" nsRouterLinkActive="active">
                <Label class="mdi" [text]="'mdi-account-circle' | fonticon"></Label>
                <Label col="1" text="Dados Pessoais" class="sideLabel"></Label>
            </GridLayout>

            <GridLayout row="2" columns="50, *" class="sideOptions menu-top-border" [nsRouterLink]="['/pontos']" nsRouterLinkActive="active">
                <Label class="mdi" [text]="'mdi-cash-100' | fonticon"></Label>
                <Label col="1" text="Pontos Addict" class="sideLabel"></Label>
            </GridLayout>

            <GridLayout row="3" columns="50, *" class="sideOptions menu-top-border" [nsRouterLink]="['/vales']" nsRouterLinkActive="active">
                <Label class="mdi" [text]="'mdi-certificate' | fonticon"></Label>
                <Label col="1" text="Vales" class="sideLabel"></Label>
            </GridLayout>

            <GridLayout row="4" rows="auto, auto" columns="50, *" class="sideOptions menu-top-border" [nsRouterLink]="['/marcacoes']"
                nsRouterLinkActive="active">
                <Label class="mdi" [text]="'mdi-calendar-clock' | fonticon"></Label>
                <Label col="1" text="Marcações" class="sideLabel"></Label>
            </GridLayout>

            <GridLayout row="5" columns="50, auto, *" class="sideOptions menu-top-border" (tap)="openLink('https://inventore.net/agenda-online-gicnet/?id=Ajdg0100315')">
                <Label class="mdi" [text]="'mdi-calendar-check' | fonticon"></Label>
                <Label col="1" text="Agendar" class="sideLabel"></Label>
                <Label col="2" class="mdi" [text]="'mdi-open-in-new' | fonticon"></Label>
            </GridLayout>

            <GridLayout row="6" columns="50, auto, *" class="sideOptions menu-top-border" (tap)="openLink('https://www.jeanlouisdavid.pt/')">
                <Label class="mdi" [text]="'mdi-web' | fonticon"></Label>
                <Label col="1" text="Site JLD" class="sideLabel"></Label>
                <Label col="2" class="mdi" [text]="'mdi-open-in-new' | fonticon"></Label>
            </GridLayout>

            <GridLayout row="7" columns="50, auto, *" class="sideOptions menu-top-border" (tap)="openLink('https://jeanlouisdavid-shoponline.com/')">
                <Label class="mdi" [text]="'mdi-sale' | fonticon"></Label>
                <Label col="1" text="Shop Online" class="sideLabel"></Label>
                <Label col="2" class="mdi" [text]="'mdi-open-in-new' | fonticon"></Label>
            </GridLayout>

            <GridLayout row="8" columns="50, *" class="sideOptions menu-top-border" [nsRouterLink]="['/acerca']" nsRouterLinkActive="active">
                <Label class="mdi" [text]="'mdi-comment-question-outline' | fonticon"></Label>
                <Label col="1" text="Acerca" class="sideLabel"></Label>
            </GridLayout>


        </GridLayout>

    </StackLayout>

    <StackLayout tkMainContent>
        <GridLayout rows="*,auto">
            <ListView [items]="dataItems" (itemTap)="onItemTap($event)">
                <ng-template let-item="item" let-i="index" let-odd="odd" let-even="even">
                    <GridLayout class="listItemTemplateGrid" [nsRouterLink]="['/item', item.id]">
                        <!-- <NSImage height="250" stretch="aspectFill" [src]="item.imagem"></NSImage> -->
                        <NSImage height="250" stretch="aspectFill" src="res://salao1"></NSImage>
                        <GridLayout verticalAlignment="bottom">
                            <StackLayout class="labelsStackLayout">
                                <Label [text]="item.titulo1"></Label>
                                <Label [text]="item.titulo2"></Label>
                            </StackLayout>
                        </GridLayout>
                    </GridLayout>
                </ng-template>
            </ListView>
            <ActivityIndicator [busy]="isBusy" [visibility]="isBusy ? 'visible' : 'collapse'" color="white" horizontalAlignment="center"
                verticalAlignment="center"></ActivityIndicator>
        </GridLayout>
    </StackLayout>

</RadSideDrawer>

0reactions
lock[bot]commented, Aug 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nativescript: More than one layout child inside a ContentView
You must use one of the Layouts (Stack, Grid, Flex, Dock, Wrap, Absolute) if you want to hold more than one child component....
Read more >
tns-core-modules | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
How layout works in SwiftUI - a free Hacking with iOS
All SwiftUI layout happens in three simple steps, and understanding these steps is the key to getting great layouts every time.
Read more >
Arranging Views with Xamarin.Forms Layout - CODE Magazine
Although they can contain multiple child items, there's no good reason to have more than one child in these layouts.
Read more >
Source - GitHub
queueGC debounce and throttle with reuse of different settings ... **ios:** tabview background color with appearance api in iOS 15+ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found