a guest May 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- There are some differences how iOS and Android work with layouts with no predefined sizes which is causing this different output for your code. In your case your Label is wrapped in the default StackLayout with no dimensions and this is one of the reason not to be able to position your label at the vertical center. Another thing is the percentage value of your label set to 100%.
- What I can suggest is to use different layouts for cases when you need to control both horizonal and vertical aligment.
- <GridLayout rows="*" columns="*" style.backgroundColor="gray" >
- <Label row="0" text="vertically centered" style.verticalAlignment="center" style.textAlignment="center" textWrap="true"> </Label>
- With the above snippet, we are creating a GridLayout which will take all the available space for rows and columns (using *) and for that space will position your label vertically aligned to the center.
RAW Paste Data