c# - How to anchor UI elements to the bottom of a Relative Layout and expand upward in Xamarin Forms? -
i have pretty picture of sunrise. want relatively position elements under it. i've been doing ok computing more or less height top sunrise ends , beginning text there. now, i'd different way. want put stacklayout, anchor stacklayout @ bottom , expand upwards.
this code i've started with, doesn't accomplish it. i found other post similar didn't have luck doing (you can see end
in code below. suspect relatively positioned image sitting behind problem.
<contentpage.content> <stacklayout orientation="vertical"> <relativelayout padding="0,0"> <image source="{ext:imageresource myapp.sunrise.png}" aspect="aspectfill" relativelayout.widthconstraint="{constraintexpression type=relativetoparent, property=width}" heightrequest="250" /> <stacklayout relativelayout.widthconstraint="{constraintexpression type=relativetoparent, property=width}" heightrequest="250" verticaloptions="end" horizontaloptions="startandexpand"> <label text="apples , oranges"/> <label text="meat , potatoes"/> </stacklayout> </relativelayout> </stacklayout> </contentpage.content>
here's sketch:
Comments
Post a Comment