我正在尝试为Android AndTinder库创建一个绑定库。但我收到以下错误
Error CS0507: 'Com.Andtinder.View.SimpleCardStackAdapter.GetCardView(int, Com.Andtinder.Model.CardModel, Android.Views.View, Android.Views.ViewGroup)': cannot change access modifiers when overriding 'protected' inherited member 'Com.Andtinder.View.CardStackAdapter.GetCardView(int, Com.Andtinder.Model.CardModel, Android.Views.View, Android.Views.ViewGroup)' (CS0507)
要修复上述错误,我将以下行添加到Metadata.xml
<attr path="/api/package[@name='Com.AndTinder.View']/class[@name='CardStackAdapter']/method[@name='GetCardView']" name="visibility">protected</attr>
但这还没有解决。如果有人能给我提示如何修复此错误,我将不胜感激
答案 0 :(得分:1)
基类受到保护。因此,您希望通过将C#版本更改为受保护来解决此问题。
基于包:package com.andtinder.view;
MethodName getCardView
:https://github.com/kikoso/Swipeable-Cards/blob/master/AndTinder/src/main/java/com/andtinder/view/CardStackAdapter.java#L69
<attr path="/api/package[@name='com.andtinder.view']/class[@name='CardStackAdapter']/method[@name='getCardView']" name="visibility">protected</attr>
总的来说,您似乎只需要确保您的区分大小写,这应该有效!