How to make TabLayout in fragments, what would be such submenus

You need to implement TabLayout in fragments

  • The question is not clear. I correctly understand that you tried to just make such a markup but you did not succeed? Or are you asking about fundamentally opportunities? If the latter is yes, it is possible. In the pull-out menu, you can put absolutely any markup, there are no restrictions. - YurySPb
  • Yes, I can not make such a markup - PaNDa11v48
  • Why don't you show the markup and tell what exactly didn’t work out ... ... - YuriySPb
  • The markup can be simply taken from the templates, the main question is how to add it to the fragment - PaNDa11v48
  • one
    Override the onCreateView method in the fragment and load the markup there. Further, if you want nested fragments, you need to getChildFragmentManager() . In the first part you can use any introductory lesson on the fragments. You still have not explained what you have a specific problem. Did you try to place the markup yourself? - Yuriy SPb

1 answer 1

Because the question is actually about what a fragment is and how to use it, I’ll just give the fragment code with the markup loaded into it

 public class MyFragment extends Fragment{ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_layout, container, false); } }