Android Question how to center dynamically image

Roberto P.

Well-Known Member
Licensed User
Longtime User
how can I center the image dynamically according to the size and orientation of the screen?
thanks you
 

Attachments

  • Immagine.png
    Immagine.png
    295.2 KB · Views: 492
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
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
does not work!? the image is not displayed ...
I attach the file. thanks
 

Attachments

Upvote 0
You should attach the WHOLE PROJECT not only the .bal file.

The problem I see is the ANCHORS, change the values to:
Code: Copy
Horizontal anchor = Left
Vertical anchor = Top
And change the ImageView width and Height to 200dip.

You can tweak that later of course.
 
Last edited:
Upvote 0
Back
Top