iOS Code Snippet iDSTabLayout

Discussion in 'iOS Code Snippets' started by Emme Developer, Apr 25, 2017.

  1. Emme Developer

    Emme Developer Member Licensed User

    Good morning! I think B4i and B4a are really amazing products. In order to develop easier application cross-platoform, i made a little "port" of Android DSTabLayout. I'm working to add more and more methods and optimize it.

    NB: SetViewPager must be call as last method
    NB2: DSTabLayout is a custom view, so you should add it on designer
    Simple code to use it:

    Code:
    Dim listmod As List = Array As String("LV_30","LV_31","LV_32","LV_33","LV_34")
        
    For i = 0 To listmod.Size-1
            
    Dim p As Panel
            p.Initialize(
    "")
            p.Color = 
    0xFF313131
            
    Dim scv As ScrollView
            scv.Initialize(
    "",Main.MainPage.RootPanel.Width,8dip)
            p.AddView(scv,
    0,0,Main.MainPage.RootPanel.Width,Main.MainPage.RootPanel.Height-48dip)
            DSTab.AddPage2(p)
        
    Next
     
        DSTab.TabMode = DSTab.Mode_Fixed
        DSTab.SetTabTextColors(
    0xffffffff,0xffd0d0d0)
        DSTab.IndicatorVisible = 
    False
        DSTab.ColorTabber = 
    Colors.ARGB(2553150204)
     
        
    For i = 0 To listmod.Size-1
            
    Dim s As String = listmod.Get(i)
            DSTab.SetTabText(i,s.Replace(
    "_"," "))
        
    Next
     
        DSTab.SetViewPager
     

    Attached Files:

    webhost.company, jahswani and Erel like this.
Loading...