Roberto P. Well-Known Member Licensed User Longtime User Mar 31, 2014 #1 how can I center the image dynamically according to the size and orientation of the screen? thanks you Attachments Immagine.png 295.2 KB · Views: 249
how can I center the image dynamically according to the size and orientation of the screen? thanks you
eps Expert Licensed User Longtime User Mar 31, 2014 #2 Work out the width and height of the screen or panel. Divide both by 2. You either know the height and width of the image or can work those out Divide both by 2. Take away from the screen numbers and then place. Upvote 0
Work out the width and height of the screen or panel. Divide both by 2. You either know the height and width of the image or can work those out Divide both by 2. Take away from the screen numbers and then place.
NJDude Expert Licensed User Longtime User Mar 31, 2014 #3 Using the designer scripts: B4X: LogoSplash.HorizontalCenter = 50%x LogoSplash.VerticalCenter = 50%y Upvote 0
Roberto P. Well-Known Member Licensed User Longtime User Mar 31, 2014 #5 thank you, but if I use your information, I see no picture!? perhaps we need to subtract the width of the left panel and then do the calculation? thanks for help Upvote 0
thank you, but if I use your information, I see no picture!? perhaps we need to subtract the width of the left panel and then do the calculation? thanks for help
Erel B4X founder Staff member Licensed User Longtime User Mar 31, 2014 #6 If the parent is a panel (Panel1): B4X: LogoSplash.HorizontalCenter = Panel1.Width / 2 LogoSplash.VerticalCenter = Panel1.Height / 2 Upvote 0
If the parent is a panel (Panel1): B4X: LogoSplash.HorizontalCenter = Panel1.Width / 2 LogoSplash.VerticalCenter = Panel1.Height / 2
Roberto P. Well-Known Member Licensed User Longtime User Mar 31, 2014 #7 the parent is the Activity. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 31, 2014 #8 In that cast the code @NJDude posted is correct. If it doesn't work for you then please upload the layout file. Upvote 0
In that cast the code @NJDude posted is correct. If it doesn't work for you then please upload the layout file.
Roberto P. Well-Known Member Licensed User Longtime User Mar 31, 2014 #9 does not work!? the image is not displayed ... I attach the file. thanks Attachments homepage.bal 3.8 KB · Views: 148 Upvote 0
NJDude Expert Licensed User Longtime User Mar 31, 2014 #10 You should attach the WHOLE PROJECT not only the .bal file. The problem I see is the ANCHORS, change the values to: B4X: Horizontal anchor = Left Vertical anchor = Top And change the ImageView width and Height to 200dip. You can tweak that later of course. Last edited: Mar 31, 2014 Upvote 0
You should attach the WHOLE PROJECT not only the .bal file. The problem I see is the ANCHORS, change the values to: B4X: Horizontal anchor = Left Vertical anchor = Top And change the ImageView width and Height to 200dip. You can tweak that later of course.
Roberto P. Well-Known Member Licensed User Longtime User Mar 31, 2014 #11 okay, here's the project I'm doing my tests .... thanks Attachments ActionBar.zip 504.5 KB · Views: 193 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 1, 2014 #12 You can use the anchors feature for the splash screen: However if you set the anchors to BOTH then the view should be large enough. Otherwise it will disappear on smaller devices. In this case you do not need to set anything in the designer script. Upvote 0
You can use the anchors feature for the splash screen: However if you set the anchors to BOTH then the view should be large enough. Otherwise it will disappear on smaller devices. In this case you do not need to set anything in the designer script.