Android Question [B4X] ASSegmentedTab - Fix width of a Tab

Mike1970

Well-Known Member
Licensed User
Longtime User
Hi everyone,
very amazed by the work of @Alexander Stolte !!!

I'm implementing it in my project right now.
Only one thing is not clear to me:
Is it possible to fix the width of a specific element?


I need to achieve this result
Screenshot 2023-10-28 alle 18.08.57.png


where the icon has a smaller tab, while the other tabs can adjust their sizes as usual.

Someone knows if it is possible?

Thanks in advance
 
Solution
Is it possible to fix the width of a specific element?
Yes with V1.19+
B4X:
    ASSegmentedTab3.mBase.Color = xui.Color_ARGB(255,42, 156, 255)
    ASSegmentedTab3.SelectionPanel.Color = xui.Color_White
    ASSegmentedTab3.ItemTextProperties.TextColor = xui.Color_Black
    ASSegmentedTab3.ItemTextProperties.SelectedTextColor = xui.Color_Black
    ASSegmentedTab3.CornerRadiusBackground = 8dip
    ASSegmentedTab3.CornerRadiusSelectionPanel = 8dip
    ASSegmentedTab3.PaddingSelectionPanel = 4dip
    
    Dim Tab1 As ASSegmentedTab_Tab
    Tab1.Initialize
    Tab1.Icon = ASSegmentedTab3.FontToBitmap(Chr(0xE068),True,15,xui.Color_White)
    Tab1.Width = 40dip
    ASSegmentedTab3.AddTabAdvanced(Tab1)...

Alexander Stolte

Expert
Licensed User
Longtime User
Is it possible to fix the width of a specific element?
Yes with V1.19+
B4X:
    ASSegmentedTab3.mBase.Color = xui.Color_ARGB(255,42, 156, 255)
    ASSegmentedTab3.SelectionPanel.Color = xui.Color_White
    ASSegmentedTab3.ItemTextProperties.TextColor = xui.Color_Black
    ASSegmentedTab3.ItemTextProperties.SelectedTextColor = xui.Color_Black
    ASSegmentedTab3.CornerRadiusBackground = 8dip
    ASSegmentedTab3.CornerRadiusSelectionPanel = 8dip
    ASSegmentedTab3.PaddingSelectionPanel = 4dip
    
    Dim Tab1 As ASSegmentedTab_Tab
    Tab1.Initialize
    Tab1.Icon = ASSegmentedTab3.FontToBitmap(Chr(0xE068),True,15,xui.Color_White)
    Tab1.Width = 40dip
    ASSegmentedTab3.AddTabAdvanced(Tab1)

    ASSegmentedTab3.AddTab("Inizio",Null)
    ASSegmentedTab3.AddTab("Fine Prova",Null)
AS SegmentedTab Custom Tab Width.gif
 
Upvote 0
Solution

Mike1970

Well-Known Member
Licensed User
Longtime User
Yes with V1.19+
B4X:
    ASSegmentedTab3.mBase.Color = xui.Color_ARGB(255,42, 156, 255)
    ASSegmentedTab3.SelectionPanel.Color = xui.Color_White
    ASSegmentedTab3.ItemTextProperties.TextColor = xui.Color_Black
    ASSegmentedTab3.ItemTextProperties.SelectedTextColor = xui.Color_Black
    ASSegmentedTab3.CornerRadiusBackground = 8dip
    ASSegmentedTab3.CornerRadiusSelectionPanel = 8dip
    ASSegmentedTab3.PaddingSelectionPanel = 4dip
   
    Dim Tab1 As ASSegmentedTab_Tab
    Tab1.Initialize
    Tab1.Icon = ASSegmentedTab3.FontToBitmap(Chr(0xE068),True,15,xui.Color_White)
    Tab1.Width = 40dip
    ASSegmentedTab3.AddTabAdvanced(Tab1)

    ASSegmentedTab3.AddTab("Inizio",Null)
    ASSegmentedTab3.AddTab("Fine Prova",Null)
View attachment 147330
AWESOME.

This is one of my favorite b4x view, if not the first one.
 
Upvote 0
Top