Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Can't create Forms Picker custom rendere

$
0
0

Hi i easily created custom renderer for Forms Entry control, but when i tried to create one to Picker i get this error:

Error CS0115: `Punteam.iOS.PunteamPickerRederer.OnElementChanged(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs<Xamarin.Forms.Picker>)' is marked as an override but no suitable method found to override (CS0115) (Punteam.iOS)<

this is my code on Forms project:

using System;

using Xamarin.Forms;

namespace Punteam
{
public class PunteamPicker : Picker
{
}
}

on IOS:

using Xamarin.Forms.Platform.iOS;

using Xamarin.Forms;
using Xamarin.Forms.Platform;
using Punteam;
using Punteam.iOS;
using UIKit;
using EventKitUI;

[assembly: ExportRenderer (typeof(PunteamPicker), typeof(PunteamPickerRederer))]

namespace Punteam.iOS
{

public class PunteamPickerRederer : PunteamPicker
{
    protected override void OnElementChanged (ElementChangedEventArgs<Picker> e)
    {

/* base.OnElementChanged (e);

        this.Control.TextAlignment = MonoTouch.UIKit.UITextAlignment.Center;

        this.Control.TextColor = UIColor.White;

        this.Control.BackgroundColor = UIColor.Clear;
        this.Control.BorderStyle = UITextBorderStyle.RoundedRect;
        this.Layer.BorderWidth = 1.0f;
        this.Layer.CornerRadius = 4.0f;
        this.Layer.MasksToBounds = true;
        this.Layer.BorderColor = UIColor.White.CGColor;*/
    }
}

}

i took this from a sample


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>