I am trying to use PopupWindow to inflate layout, but I have not found any example in internet. Could you teach me how to use it.
This is my current code but it is not showing popupWindow
private void ShowMenu(ImageButton anchor, Dictionary<string, object> data)
{
LayoutInflater inflater = (LayoutInflater)_context.GetSystemService(Context.LayoutInflaterService);
View popupView = inflater.Inflate(Resource.Layout.menu_outlet_buttons, null);
int width = LinearLayout.LayoutParams.WrapContent;
int height = LinearLayout.LayoutParams.WrapContent;
bool focusable = true;
PopupWindow popupWindow = new PopupWindow(popupView.Context);
popupWindow.ShowAtLocation(_view, GravityFlags.Center, 0, 0);
}
By the way this is an Adapter
public MyAdapter(List<Dictionary<string, object>> data, Context context)
{
_data = data;
_context = context;
}
This is my reference, but I could not reproduce the same in Xamarin Android.