Android - Start Fragemnt from another Fragment C#

后端 未结 3 1185
长情又很酷
长情又很酷 2021-01-28 00:20

I know this question has been asked too much here but i ahve tried every solution out there to open a fragment from another fragment and no one worked for me.

Fr

3条回答
  •  孤街浪徒
    2021-01-28 01:18

    You have to attach your Click event to your button before return the view, and I think that you want to attach this event on your addbtn so you have to create the variable add before to attach this event

    public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        View view = inflater.Inflate(Resource.Layout.my_layout, container, false);
        Button add = view.FindViewById

提交回复
热议问题