-5

hi i create a Dynamic tab layout and also create dynamic list view . now how i can display list view content in frame layout?

        List<string> cu = new List<string>();
        cu.Add("1");
        cu.Add("2");
        ListView listView = new ListView(this);
        TabContentListAdapter tabContentListAdapter = new 
        TabContentListAdapter(this, cu);
        listView.SetAdapter(tabContentListAdapter);

        tabView = new SfTabView(this.ApplicationContext);

        var favoritesGrid = new FrameLayout(listView.Context);

In this line, I pass the listView.Context to FrameLayout But not displayed؟!؟!

Note: SfTabView is a TabLayout control library.

amir
  • 1
  • 1
  • 2
    Please correct Your question like: the sentence begins with a capital letter; code should be well formatted. Imagine You see this question. Would You be able to understand here the displayed problem? Have You ever searched on SO for any similar problem? Did You write "how to add view to TabLayout"? – deadfish Jun 10 '18 at 22:04

1 Answers1

0

You will have to add the listview to the frame layout using addViewMethod

favoritesGrid.addView(listView);

You may have to set layout params to the listView as well in order to get the UI to your liking. Follow this answer to learn how to use LayoutParams https://stackoverflow.com/a/2397869/4260786

Suhaib Roomy
  • 2,501
  • 1
  • 16
  • 22