set background image to relative layout in xamarin.forms -
how can set background image relative layout in xamarin.forms
portable project?
i have tried following code:
xamal file:
<relativelayout x:name="title"> <label text="hello xamarin" textcolor="black" fontsize="22" fontfamily="tahoma" horizontaloptions="center" horizontaltextalignment="center" relativelayout.xconstraint="{constraintexpression type=relativetoparent,property=width, factor=0.03}" relativelayout.yconstraint="{constraintexpression type=relativetoparent, factor=0, property=y}" />
xaml.cs file:
public partial class mainapp : contentpage { public image bgimage { get; set; } public mainapp() { this.backgroundimage = "/images/landing_page.jpg"; bindingcontext = this; initializecomponent(); } }
you can add image view relative layout, please see following link;
https://forums.xamarin.com/discussion/17794/image-as-background
Comments
Post a Comment