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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -