xamarin.ios - I want to add my own image to switch Control in ios using Xamarin forms -
i tried add own image switch control in xamarin forms using rendering concept unable override existing image.below code. in shared project added code this
switch switcher = new extendedswitchnew();
and in ios
[assembly: exportrenderer(typeof(extendedswitchnew),typeof(switchrenderernew))] namespace test.ios { public class switchrenderernew :switchrenderer { protected override void onelementchanged(elementchangedeventargs<switch> e) { base.onelementchanged(e); if (control != null) { uiimage imgon = uiimage.fromfile("images/switchon.png"); uiimage imgoff = uiimage.fromfile("images/switchoff.png"); control.onimage = imgon; control.offimage = imgoff; } } } }
help me.thanks in advace.
Comments
Post a Comment