How to setContentView in a fragment?

前端 未结 5 1820
说谎
说谎 2020-11-29 05:53

Now I\'ve got this fragment which i want to use setContentView with but so far i cant find how. You can see my case in the code below, im not trying to inflate a layout, im

5条回答
  •  悲&欢浪女
    2020-11-29 06:27

    In activities we need to set the view using setContentView(R.layout.main)

    Where as in fragments we need to override onCreateView() to set the desired view.

提交回复
热议问题