Hi
I need to anchor some component to button right corner of view so if user extend the browser it always anchor at right button corner like app bar icon.
How can I do that in perspective?
There are several ways to do this, but it all depends on the layout of your View.
One easy way:
- Construct your View with a Flex Container (
props.direction
set to column). - Place what you would like as your “primary” container type first (in the attached View I used a Column Container); we will call this the “Primary” container for this example.
- Now Place a second Flex Container, and set this Flex Container’s
props.direction
to “column-reverse”. - Set the
position.basis
for this Flex Container to whatever height you want your Button to have. - Deep-select this child Flex Container and place a third Flex Container, and set this Flex Container’s
props.direction
to “row-reverse”. - Deep-select the third Flex Container we just placed and place a button into it.
- Now go all the way back to the “Primary” container you placed into your root container, and set
position.grow
to1
.
Your structure should look like this:
Here’s the View I constructed:
view.json (1.6 KB)
4 Likes