Why is my custom ButtonRenderer not working?

前端 未结 2 1783
无人及你
无人及你 2020-12-10 21:42

I\'m trying to create a custom ButtonRenderer for Xamarin.Forms. Here is a simple test I\'ve been trying to put up together following some tutorials, but I can\'s seem to ma

2条回答
  •  佛祖请我去吃肉
    2020-12-10 22:20

    I'm still investigating on this. Your class gets shrunk because it's not statically linked in your PCL. You avoid that by giving a name to your classes like this:

    [Activity(Name = "somepackage.custombuttonrenderer")]
    public class CustomButtonRenderer: ButtonRenderer
    { }
    

    If you're able to target the minimum Android version to Android 5.0 (Api 21) this problem should disappear as another version of the Dex file is used.

提交回复
热议问题