Android Question B4X Custom Dialog Disappearing Title

bocker77

Active Member
Licensed User
Longtime User
I am experiencing an issue with the title not appearing when increasing the panel height. The panel width works.

B4X:
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 300dip, 300dip)
    p.LoadLayout("RandD")
    p.Height = 55%y
    p.Width = 55%x
    Dim rsp As ResumableSub = Dialog.ShowCustom(p, "Yes", "No", "")
    Dim btnYes As B4XView = Dialog.GetButton(xui.DialogResponse_Positive)
    btnYes.SetBitmap(bmpBtnUp)
    Dim btnNo As B4XView = Dialog.GetButton(xui.DialogResponse_Negative)
    btnNo.SetBitmap(bmpBtnUp)
    Wait For (rsp) Complete (Result As Int)

No Dialog Title.png


If I comment out p.Height I get this.

Dialog Title.png


Before I moved this code block and inserted it in at another place in my code I was able to fix it by adding Dialog.PutAtTop = True. But for some reason now I can't get it to work by doing this. Not sure what's going on.
 

bocker77

Active Member
Licensed User
Longtime User
Thanks I will try your suggestion but still think there is an issue with the title not making an appearance on what I tried. In spite of my travails with this I am liking these B4X Dialogs!
 
Upvote 0

bocker77

Active Member
Licensed User
Longtime User
Nope that didn't work. Result - with those values a very long dialog in length and a narrow width and most importantly "no title".
 
Upvote 0

bocker77

Active Member
Licensed User
Longtime User
Sagenut, I tried your suggestion but still no Title.

LucaMs, the bal file zipped is attached.
 

Attachments

  • randd.zip
    1.8 KB · Views: 54
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Sorry but I am getting lost, maybe because of missing files.
I am unable to help.
Sorry.
 
Upvote 0

bocker77

Active Member
Licensed User
Longtime User
Maybe this will help.

B4X:
    Dim bmpAxisAllies As Bitmap = LoadBitmap(File.DirAssets, "Axis & Allies.png")

Sub InitializeDialog As ResumableSub
    ' Setup Message Dialog
    csMsgTitle.Initialize.Image(bmpAxisAllies, 130dip, 40dip, False)
    csMsgText.Initialize.Typeface(fntMsgSerif).Size(18)
    Dialog.Initialize(Root)
    Dialog.Title = csMsgTitle
    Dialog.TitleBarHeight = 60dip
    Dialog.TitleBarColor = Steel
    Dialog.BackgroundColor = xui.Color_RGB(250, 235, 215)
    Dialog.BodyTextColor = xui.Color_Black
    Dialog.BorderWidth = 10
    Dialog.BorderColor = Steel
    Dialog.BorderCornersRadius = 10
    Dialog.ButtonsTextColor = xui.Color_Black
    Dialog.ButtonsFont = xui.CreateFont(Typeface.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 18)
    Dialog.ButtonsHeight = 50dip
    Dialog.PutAtTop = True

    Return True
End Sub

Along with.

B4X:
    Dialog.PutAtTop = True
    Dialog.Title = csMsgTitle
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 55%x, 55%y)
    p.LoadLayout("RandD")
'    p.Height = 55%y
'    p.Width = 55%x
    Dim rsp As ResumableSub = Dialog.ShowCustom(p, "Yes", "No", "")
    Dim btnYes As B4XView = Dialog.GetButton(xui.DialogResponse_Positive)
    btnYes.SetBitmap(bmpBtnUp)
    Dim btnNo As B4XView = Dialog.GetButton(xui.DialogResponse_Negative)
    btnNo.SetBitmap(bmpBtnUp)
    Wait For (rsp) Complete (Result As Int)
 

Attachments

  • Axis & Allies.png
    Axis & Allies.png
    50.2 KB · Views: 40
Upvote 0

bocker77

Active Member
Licensed User
Longtime User
Should have added this.

B4X:
Dim fntMsgSerif As Typeface = Typeface.CreateNew(Typeface.SERIF, Typeface.STYLE_NORMAL)
 
Upvote 0

bocker77

Active Member
Licensed User
Longtime User
sorry more.
B4X:
    Dim bmpBtnUp As Bitmap = LoadBitmap(File.DirAssets, "Gold Button Up.png")    
    Dim bmpBtnDis As Bitmap = LoadBitmap(File.DirAssets, "Gold Button Disabled.png")
 

Attachments

  • Gold Button Disabled.png
    Gold Button Disabled.png
    5.1 KB · Views: 42
  • Gold Button Up.png
    Gold Button Up.png
    6.4 KB · Views: 38
Upvote 0

bocker77

Active Member
Licensed User
Longtime User
I believe that I found the problem.


Dialog's height is too big. I believe I will need to use smaller fonts to get this to work. Do you have any idea what the height max can be without loosing the Title?
 
Upvote 0
Top