我將這個https://github.com/blazsolar/HorizontalPicker庫轉換爲Java綁定庫。 該庫實現了一個OnItemSelected事件,它在Java中使用像這樣。Java事件綁定問題綁定庫
@Override
public void onItemSelected(int index) {
Toast.makeText(this, "Item selected", Toast.LENGTH_SHORT).show();
}
現在我想在我的C#代碼中使用它。
var Picker = view.FindViewById<Com.Wefika.Horizontalpicker.HorizontalPicker>(Resource.Id.numberPicker);
Picker.onItemClicked+= delegate{};
不幸的是onItemClicked不存在。 我查看了生成的API xml,並在那裏聲明。
<interface abstract="true" deprecated="not deprecated" final="false" name="HorizontalPicker.OnItemClicked" static="true" visibility="public">
<method abstract="true" deprecated="not deprecated" final="false" name="onItemClicked" native="false" return="void" static="false" synchronized="false" visibility="public">
現在I'm想知道如何我可以使用這個事件? 我必須修改某些內容嗎?或者我可以用不同的方式獲得它?
你能不能讓Java綁定庫可用,所以我可以檢查出來嗎? – Cyriac
https://gitlab.com/Olias/binding/tree/master/Binding_HorizontalPicker – Olias