Alexander Stolte Expert Licensed User Longtime User Mar 12, 2021 #1 I add 7 panels to the main panel and resize them to fit so that they are displayed side by side. This causes 2 gaps between the panels. B4X: For i = 0 To 7 -1 Dim xpnl As B4XView = xui.CreatePanel("") xpnl.Color = xui.Color_Red Panel1.AddView(xpnl,Panel1.Width/7*i,0,Panel1.Width/7,Panel1.Height) Next How can i remove this 2 white gabs? The main panel is white. Attachments Test.zip Test.zip 8.3 KB · Views: 380
I add 7 panels to the main panel and resize them to fit so that they are displayed side by side. This causes 2 gaps between the panels. B4X: For i = 0 To 7 -1 Dim xpnl As B4XView = xui.CreatePanel("") xpnl.Color = xui.Color_Red Panel1.AddView(xpnl,Panel1.Width/7*i,0,Panel1.Width/7,Panel1.Height) Next How can i remove this 2 white gabs? The main panel is white.
roumei Active Member Licensed User Mar 12, 2021 #2 It's caused by the float to int conversion. You could try something like this: B4X: Panel1.AddView(xpnl,Floor(Panel1.Width/7*i),0,Ceil(Panel1.Width/7),Panel1.Height) This will create 7 panels with a constant width and a slight overlap and makes sure that no gaps are visible. If the overlap is not acceptable, you can create 6 panels with a width of int(Panel1.Width/7) and the seventh with the remaining space Panel1.Width-6*int(Panel1.Width/7). Upvote 0
It's caused by the float to int conversion. You could try something like this: B4X: Panel1.AddView(xpnl,Floor(Panel1.Width/7*i),0,Ceil(Panel1.Width/7),Panel1.Height) This will create 7 panels with a constant width and a slight overlap and makes sure that no gaps are visible. If the overlap is not acceptable, you can create 6 panels with a width of int(Panel1.Width/7) and the seventh with the remaining space Panel1.Width-6*int(Panel1.Width/7).
mangojack Expert Licensed User Longtime User Mar 12, 2021 #3 Possibly just add extra dip to the width ? .. Code: Panel1.AddView(xpnl,Panel1.Width/7*i, 0, (Panel1.Width/7) +1Dip, Panel1.Height) Edit : added border to panels as a test , the result appeared Ok... Last edited: Mar 12, 2021 Upvote 0
Possibly just add extra dip to the width ? .. Code: Panel1.AddView(xpnl,Panel1.Width/7*i, 0, (Panel1.Width/7) +1Dip, Panel1.Height) Edit : added border to panels as a test , the result appeared Ok...