B4A Library ElevateUI Improve the graphic interface of your b4a applications

fernando1987

Active Member
Licensed User
Announcing UITabBar for ElevateUI 4.7

We are excited to introduce UITabBar, a new addition to the ElevateUI library that brings modern, sleek, and highly customizable tab navigation to your B4X projects. This custom view is designed to make your UI even more dynamic and interactive!


Documentation for UITabBar

Designer Properties

UITabBar comes with a variety of customizable properties that can be set in the Designer:

  • TextColor: Text color of the tabs. Default: Modern Gray 0xFF3C4043.
  • ActiveColor: Color of the active tab. Default: Modern Blue 0xFF1E88E5.
  • BackgroundColor: Background color of the tab bar. Default: Light Gray 0xFFF5F5F5.
  • BorderColor: Border color of the tab bar. Default: Soft Gray 0xFFB0BEC5.
  • TextSize: Font size of the tab text. Range: 12–24. Default: 16.
  • BorderWidth: Width of the tab bar border. Range: 0–10. Default: 0.
  • AnimationDuration: Speed of the active tab transition animation. Options: Fast, Normal, Slow. Default: Normal.
  • CornerRadius: Radius for rounded corners. Range: 0–50. Default: 50.

Events

  • itemClicked (ItemName As String, ItemIndex As Int)
    Fired when a tab is clicked, returning the name and index of the selected tab.

Public Methods

  1. AddOption(Text As String)
    Adds a single tab with the specified text.
  2. AddOptions(Texts As List)
    Adds multiple tabs from a list of strings.
  3. SetActive(Number As Int)
    Sets the active tab programmatically by its index.
  4. Show
    Renders the tab bar after all options are added.
  5. SetCornerRadius(Radius As Int)
    Updates the corner radius of the tabs.
  6. ActiveColor(Color As Int)
    Changes the active tab color dynamically.
  7. TextColor(Color As Int)
    Updates the text color for inactive tabs.
  8. TextSize(Size As Int)
    Changes the font size of the tab text.
  9. GetTexts As List
    Returns the list of tab names.
  10. GetSize As Int
    Returns the number of tabs.

Example Usage of UITabBar

Here’s a quick example demonstrating how to use UITabBar in your B4X project:

' Example Usage of UITabBar:
Sub Globals
Private tabBar As UITabBar
End Sub

Sub Activity_Create(FirstTime As Boolean)
' Load layout with UITabBar added via Designer
Activity.LoadLayout("Main")

' Add tabs dynamically
tabBar.AddOptions(Array As String("Home", "Search", "Profile", "Settings"))
tabBar.Show ' Render the tab bar

End Sub

Sub tabBar_itemClicked(ItemName As String, ItemIndex As Int)
Log($"Tab clicked: ${ItemName} at index ${ItemIndex}"$)

Select ItemIndex
Case 0
Log("Navigate to Home")
Case 1
Log("Navigate to Search")
Case 2
Log("Navigate to Profile")
Case 3
Log("Navigate to Settings")
End Select

End Sub


Why Choose UITabBar?

Modern Design: Add polished and professional tab navigation to your apps.
Customizable: Adjust colors, sizes, animations, and more to match your app’s style.
Dynamic Updates: Add tabs dynamically and respond to user interactions seamlessly.


How to Update if You’re an Existing Customer
If you’ve already purchased ElevateUI, you can download the latest version with UITabBar included by following these steps:
Log in to your account.
Navigate to the downloads section.
Download the latest update.


Experience the Power of UITabBar in ElevateUI Today!
Let us know what you think or share your feedback in the comments below. Happy coding!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…