iOS Question Wobble menu not always displaying

tsteward

Well-Known Member
Licensed User
Longtime User
I am using Wobblemenu on windows & android with no problems. On B4I when app loads wobble menu is not visible just some tiny lines in bottom left of screen like it has resize to way too small.
If I rotate the phone to landscape, then wobble menu appears. Turn back to portrait view and all is perfect

Any suggestions on what to look for or anyone had this issue?
 
D

Deleted member 103

Guest
Try so.
Add an IF query whether the menu is already initialized, otherwise it will be initialized several times.

B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
    Page1.Initialize("WobbleMenu")

WobbleMenu1.SetTabTextIcon(1,"Menu 1",Chr(0xF009),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(2,"Menu 2",Chr(0xF0CA),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(3,"Menu 3",Chr(0xF0EC),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(4,"Menu 4",Chr(0xF24D),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(5,"Menu 5",Chr(0xF2C0),Font.CreateFontAwesome(24))

    WobbleMenu1.SetBadge(4,5,Colors.White,Colors.red)
End Sub
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Try so.
Add an IF query whether the menu is already initialized, otherwise it will be initialized several times.

B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
    Page1.Initialize("WobbleMenu")

WobbleMenu1.SetTabTextIcon(1,"Menu 1",Chr(0xF009),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(2,"Menu 2",Chr(0xF0CA),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(3,"Menu 3",Chr(0xF0EC),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(4,"Menu 4",Chr(0xF24D),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(5,"Menu 5",Chr(0xF2C0),Font.CreateFontAwesome(24))

    WobbleMenu1.SetBadge(4,5,Colors.White,Colors.red)
End Sub

modified view, comment to author
B4X:
'    AbsoluteWidth    = Min(mBase.Parent.Width, mBase.Parent.Height)
'    MenuHeight         = (AbsoluteWidth/7) + ((AbsoluteWidth/7)/4)
'    mBase.Height     = MenuHeight
'    mBase.Top         = mBase.Parent.Height - mBase.Height
'    circleRadius     = AbsoluteWidth/7
  
'    DrawView

    Base_Resize(mBase.Width, mBase.Height)
  
End Sub

Private Sub Base_Resize (Width As Double, Height As Double)
    mBase.Width     = Width
    AbsoluteWidth    = Min(mBase.Parent.Width, mBase.Parent.Height)
    MenuHeight         = (AbsoluteWidth/7) + ((AbsoluteWidth/7)/4)
    mBase.Height     = MenuHeight
    mBase.Top         = mBase.Parent.Height - mBase.Height
    circleRadius     = AbsoluteWidth/7
  
    DrawView
End Sub
 
Last edited:
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Try so.
Add an IF query whether the menu is already initialized, otherwise it will be initialized several times.

B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
    Page1.Initialize("WobbleMenu")

WobbleMenu1.SetTabTextIcon(1,"Menu 1",Chr(0xF009),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(2,"Menu 2",Chr(0xF0CA),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(3,"Menu 3",Chr(0xF0EC),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(4,"Menu 4",Chr(0xF24D),Font.CreateFontAwesome(24))
    WobbleMenu1.SetTabTextIcon(5,"Menu 5",Chr(0xF2C0),Font.CreateFontAwesome(24))

    WobbleMenu1.SetBadge(4,5,Colors.White,Colors.red)
End Sub
As per the example from the libraries page he doesn't use initialise. And nor have I as the view is added in the designer.
Is this wrong?

Authors example code:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private AHViewPager1 As AHViewPager
    Private WobbleMenu1 As WobbleMenu
    
    Private pagecont As AHPageContainer
End Sub

Public Sub Initialize
    pagecont.Initialize
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    
    WobbleMenu1.SetTabTextIcon(1,"Page 1", Chr(0xE3D0), Typeface.MATERIALICONS)
    WobbleMenu1.SetTabTextIcon(2,"Page 2", Chr(0xE3D1), Typeface.MATERIALICONS)
    WobbleMenu1.SetTabTextIcon(3,"Page 3", Chr(0xE3D2), Typeface.MATERIALICONS)
    WobbleMenu1.SetTabTextIcon(4,"Page 4", Chr(0xE3D4), Typeface.MATERIALICONS)
    WobbleMenu1.SetTabTextIcon(5,"Page 5", Chr(0xE3D5), Typeface.MATERIALICONS)
    
    For i=0 To 4
        Dim p As Panel = xui.CreatePanel("")
        p.SetLayout(0,0,AHViewPager1.Width,AHViewPager1.Height)
        
        'load any layout
        'p.LoadLayout("")
        
        'or add views from code
        p.Color = Colors.LightGray
        Dim l As Label
        l.Initialize("")
        l.Text = "Page "&(i+1)
        l.Gravity = Gravity.CENTER
        l.TextColor = Colors.Black
        l.TextSize = 40
        p.AddView(l,0,0,AHViewPager1.Width,AHViewPager1.Height)
        
        pagecont.AddPage(p,"")
    Next
    
    AHViewPager1.PageContainer = pagecont
    AHViewPager1.CurrentPage = 2
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Sub WobbleMenu1_Tab1Click
    AHViewPager1.GotoPage(0,True)
End Sub

Sub WobbleMenu1_Tab2Click
    AHViewPager1.GotoPage(1,True)
End Sub

Sub WobbleMenu1_Tab3Click
    AHViewPager1.GotoPage(2,True)
End Sub

Sub WobbleMenu1_Tab4Click
    AHViewPager1.GotoPage(3,True)
End Sub

Sub WobbleMenu1_Tab5Click
    AHViewPager1.GotoPage(4,True)
End Sub
 
Upvote 0
D

Deleted member 103

Guest
I'm sorry, but I can't help you with B4XPage, because I don't use B4XPage and also the library "Wobblemenu".

But I think that the tip from @oparra should be correct.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Friend, it was just a solution I saw in the code, if you need answers, ask the author of the view.


regards,
 
Upvote 0
Top