Nativescript: Add a bottom and right property for AbsoluteLayout

Created on 3 Sep 2015  路  9Comments  路  Source: NativeScript/NativeScript

To be able to define the position from the bottom as well as right would mean that there's no guess work in DP and would work great with elements such as the Floating Action Button.

http://www.google.com/design/spec/components/buttons-floating-action-button.html#

Most helpful comment

This is extremely annoying. I found zero workaround for my current positioning:

    left: 32;
    right: 0;

I need it for the calendar view (timeline view).

Please reopen, at least.

All 9 comments

Hey @lscown,

We have such button in our Tasks app. Can you check if this will work for you?

Thanks

The Tasks app is now removed 馃槥

+1

You could use something like this, I guess this snippet can help you, it adds a layer at the bottom

<GridLayout rows="*, auto" cols="*">

    <AbsoluteLayout row="0" top="0" left="0">

    </AbsoluteLayout>

    <AbsoluteLayout row="1">
        <GridLayout columns="auto, *, auto" class="full-width" (pan)="onPan($event)">
            <Image
                col="0"
                class="avatar"
                verticalAlignment="center"
                src="http://i.pravatar.cc/500">
            </Image>
            <StackLayout col="1" verticalAlignment="center">
                <Label
                    text="Benjam铆n Mart铆nez Mateos">
                </Label>
            </StackLayout>
            <StackLayout col="2" orientation="horizontal" verticalAlignment="center">
                <Button
                    text="SMS">
                </Button>
                <Button
                    text="CALL">
                </Button>
            </StackLayout>
        </GridLayout>
    </AbsoluteLayout>

</GridLayout>

This is extremely annoying. I found zero workaround for my current positioning:

    left: 32;
    right: 0;

I need it for the calendar view (timeline view).

Please reopen, at least.

There is currently no known way to position an element at the bottom of a screen with content which goes under it. I've currently got a swish which I can not seem to position at the bottom of the screen correctly. In this render it's too far down because the parent height it got was too tall (not including padding).

It has a 200ms timeout before requesting parent height. That's _insane_. My next guess on what to do is literal _polling_.

Screen Shot 2019-04-12 at 11 15 04 AM

Unfortunately, it's not really possible to do bottom align on ios AFAICT. You can't click through a parent but not a child, which means using a flex layout over the top is no good. You can't wait for render events, which means that hard coding it is no good. It seems this is a flaw with iOS more than nativescript, and it blows my mind.

Actually on this one I would use a GridLayout. It allows stacked items, and their is some other flags (like: isUserInteractionEnabled ) to enable click through on elements.

You'd answered that here, and it works perfectly:

https://github.com/NativeScript/NativeScript/issues/5591#issuecomment-482640921

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

AbanoubNassem picture AbanoubNassem  路  53Comments

lscown picture lscown  路  58Comments

lscown picture lscown  路  163Comments

valentinstoychev picture valentinstoychev  路  79Comments

danielzzz picture danielzzz  路  59Comments