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

Cannot create Android custom renderer when subclassing Android.Widget.xxx

$
0
0

I get the following error when creating a custom renderer on Android based on the custom widgets:—

Error CS0234: The type or namespace name Widget' does not exist in the namespaceYoubetme.Android'. Are you missing an assembly reference? (CS0234) (Youbetme.Android)

Right click - Resolve suggests “Reference ‘mono.android’ and use 'using Android.Widget;’” - both of which I am doing

using System;

using Android.Widget;

using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using System.ComponentModel;
using System.Drawing;
using MyApp;
using MyApp.Android.Renderers;

[assembly: ExportRenderer (typeof (FormsCustomButton), typeof (FormsCustomButtonRenderer))]
namespace MyApp.Android.Renderers
{
    public class FormsCustomButtonRenderer : ViewRenderer<FormsCustomButton, Android.Widget.Button]]>
    {
          }
}

Viewing all articles
Browse latest Browse all 58056

Trending Articles



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