Android + ListFragment with a custom view hierarchy

后端 未结 5 845
名媛妹妹
名媛妹妹 2021-02-12 22:28

I\'m attempting to customize the fragment layout by returning my own view hierarchy from onCreateView(LayoutInflater, ViewGroup, Bundle). This inflates my custom v

5条回答
  •  庸人自扰
    2021-02-12 23:04

    I wasn't returning the new view within the onCreateView method of the ListFragment class. For instance:

            @Override
            public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 
                View view = inflater.inflate(R.layout.main, null);
                return view;
            }
    

    All works well now in the land of Android!

提交回复
热议问题