Nativescript: Overlap one layout with other

Created on 22 Aug 2017  路  7Comments  路  Source: NativeScript/NativeScript

Hi. Iam developing one application. I have menu layout and decription layout. I need menu layout should present on description layout.

capture

Is this possible in nativescript.

question

Most helpful comment

If you wrap your layouts in a GridLayout and give them the same row number they will be positioned one on top of the other.

<GridLayout rows="*">
    <StackLayout row="0">
        <!-- Your BACKGROUND layout -->
    </StackLayout>
    <StackLayout row="0">
        <!-- Your FOREROUND layout -->
    </StackLayout>
</GridLayout>

All 7 comments

If you wrap your layouts in a GridLayout and give them the same row number they will be positioned one on top of the other.

<GridLayout rows="*">
    <StackLayout row="0">
        <!-- Your BACKGROUND layout -->
    </StackLayout>
    <StackLayout row="0">
        <!-- Your FOREROUND layout -->
    </StackLayout>
</GridLayout>

@3rror404 Thanks. It is working

@3rror404 But When I use Layout with rows="*" second layout overlaping first layout.

<GridLayout rows="*">
    <StackLayout row="0">
        <!-- Your BACKGROUND layout -->
    </StackLayout>
    <StackLayout row="0" class="second>
        <!-- Your FOREROUND layout -->
    </StackLayout>
</GridLayout>

second layout overlaiping first layout. So my first layout scrollable content not scrolling.

Hi @vijaykumarbollavaram,
The scrollable layout should be added in the latest position. For example:

<GridLayout rows="*">
    <StackLayout row="0">
        <!-- Your BACKGROUND layout -->
    </StackLayout>
    <StackLayout row="0" class="second>
        <!-- Scrollable layout -->
    </StackLayout>
</GridLayout>

Otherwise, the scroll will be blocked from the other layouts.
However, It would help if you could provide some detailed information about the case and what is the expected final result.

Hi @tsonevn . I already mention in theimage attached. I have hambergur menu bar and content wrapper.
When I use layout mentioned, hamberger menu wrapper occupying total height of screen, so i unable to scroll content.

Hi @vijaykumarbollavaram,
Did you try my last suggestion, to put the scrollable content in the latest position in the parents GridLayout.
Also, it would help if you provide sample project, which could be debugged locally. This will help to provide a correct solution.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rclai picture rclai  路  52Comments

tjvantoll picture tjvantoll  路  58Comments

lscown picture lscown  路  58Comments

morningrat picture morningrat  路  67Comments

valentinstoychev picture valentinstoychev  路  79Comments