M masky Member Licensed User Longtime User Sep 10, 2014 #1 Hello, I have a tabhost in my app defined by code. Besides this, I have a Panel defined by code too. In activity_create, I'm trying to load a layout with seven buttons, all of them created with the designer. Code: TabHost1.Initialize("TabHost1") Activity.AddView(TabHost1,0%x,0%y,100%x,100%y) Panel1.Initialize("Panel1") Panel1.LoadLayout("F27_varios") TabHost1.AddTab2("Varios",Panel1) TabHost1.AddTab("Versiones","F27_versiones") But when I want to get the number of views into the panel, this is 3 (temp=3) :-( Code: Dim temp As Byte=Panel1.NumberOfViews
Hello, I have a tabhost in my app defined by code. Besides this, I have a Panel defined by code too. In activity_create, I'm trying to load a layout with seven buttons, all of them created with the designer. Code: TabHost1.Initialize("TabHost1") Activity.AddView(TabHost1,0%x,0%y,100%x,100%y) Panel1.Initialize("Panel1") Panel1.LoadLayout("F27_varios") TabHost1.AddTab2("Varios",Panel1) TabHost1.AddTab("Versiones","F27_versiones") But when I want to get the number of views into the panel, this is 3 (temp=3) :-( Code: Dim temp As Byte=Panel1.NumberOfViews
M Mahares Expert Licensed User Longtime User Sep 10, 2014 #2 Code: Dim temp As Int=Panel1.NumberOfViews Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 10, 2014 #3 Do you see the 7 buttons when you run your app? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 10, 2014 #5 Are you sure that you have added all 7 buttons to the "activity" in the designer. If you have added them to a panel then the number returned will be different. Anyway you shouldn't use NumberOfViews. Instead iterate over all views with: Code: For Each v As View In Panel.GetAllViewsRecursive Next Upvote 0
Are you sure that you have added all 7 buttons to the "activity" in the designer. If you have added them to a panel then the number returned will be different. Anyway you shouldn't use NumberOfViews. Instead iterate over all views with: Code: For Each v As View In Panel.GetAllViewsRecursive Next