Batman_ Member Licensed User Apr 18, 2019 #1 I have a layout with an ACToolBarLight at the top and an B4X ImageViewbelow this. When the layout loads the ACToolBarLight is obscuring the B4X ImageView (see link). In Designer view I have tried this: Code: imageViewTop.Top=0%y imageViewTop.Left=0%x imageViewTop.Right=100%x and also this: Code: imageViewTop.Top=ACToolBarLight1.Bottom imageViewTop.Left=0%x imageViewTop.Right=100%x with no positive outcome. Note: I have applied the "AutoScaleAll" both on or off with no positive effect. My anchor settings and layout for the ImageView are (use link). I set the B4X imageview settings with the following code: Code: imageViewTop.SetBitmap(xui.LoadBitmapResize(File.DirAssets, Pics(Counter),imageViewTop.Width, imageViewTop.Height, False)) 'False removes KeepAspectRatio Any assistance appreciated. Attachments B4x.PNG 22.5 KB · Views: 574 Screenshot_20190418-162322.png 184.2 KB · Views: 410 Last edited: Apr 18, 2019
I have a layout with an ACToolBarLight at the top and an B4X ImageViewbelow this. When the layout loads the ACToolBarLight is obscuring the B4X ImageView (see link). In Designer view I have tried this: Code: imageViewTop.Top=0%y imageViewTop.Left=0%x imageViewTop.Right=100%x and also this: Code: imageViewTop.Top=ACToolBarLight1.Bottom imageViewTop.Left=0%x imageViewTop.Right=100%x with no positive outcome. Note: I have applied the "AutoScaleAll" both on or off with no positive effect. My anchor settings and layout for the ImageView are (use link). I set the B4X imageview settings with the following code: Code: imageViewTop.SetBitmap(xui.LoadBitmapResize(File.DirAssets, Pics(Counter),imageViewTop.Width, imageViewTop.Height, False)) 'False removes KeepAspectRatio Any assistance appreciated.
Erel B4X founder Staff member Licensed User Longtime User Apr 18, 2019 #2 Anchors are set incorrect (unless the bottom ImageView is inside a panel). This is a common mistake, discussed in this tutorial: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=254439386 Upvote 0
Anchors are set incorrect (unless the bottom ImageView is inside a panel). This is a common mistake, discussed in this tutorial: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=254439386
Brandsum Well-Known Member Licensed User Apr 18, 2019 #3 imageViewTop.Top=ACToolBarLight1.Bottom Code: imageViewTop.Top=ACToolBarLight1.Height imageViewTop.Height=100%y - ACToolBarLight1.Height - imageViewBottom.Height Upvote 0
imageViewTop.Top=ACToolBarLight1.Bottom Code: imageViewTop.Top=ACToolBarLight1.Height imageViewTop.Height=100%y - ACToolBarLight1.Height - imageViewBottom.Height
Batman_ Member Licensed User Apr 19, 2019 #4 Hi. To help any future user who has a similar issue, attached is how I set the anchors (see attachment). Here is the code I used in Designer Scripts: Code: imageViewTop.SetTopAndBottom(ACToolBarLight1.Bottom, 100%y-imageViewBottom.Height) imageViewTop.Width=100%x imageViewBottom.Width=100%x Regards. Attachments B4x Fix.PNG 11.9 KB · Views: 372 Upvote 0
Hi. To help any future user who has a similar issue, attached is how I set the anchors (see attachment). Here is the code I used in Designer Scripts: Code: imageViewTop.SetTopAndBottom(ACToolBarLight1.Bottom, 100%y-imageViewBottom.Height) imageViewTop.Width=100%x imageViewBottom.Width=100%x Regards.
Erel B4X founder Staff member Licensed User Longtime User Apr 20, 2019 #5 The designer script is not needed. Anchors will be enough here. Upvote 0