I'd like to display a face up deck of 52 cards in an Android app. I have the png/svg/bitmap files and the xml layout. I'm unsure of the settings necessary that will cause the app to resize the images to fit the screen the images are being displayed on. I've attached a mockup image of what I am trying to do. Any pointers to the right documentation to help clear this up for me?
Displaying Deck of Cards on Android's Different Screen Sizes
423 views Asked by Auburnate At
1
It depends on how you build the layouts. But essentially you should look into using
displayMetrics
:How to get screen display metrics in application class
You can use that to determine the size (width/height) of the screen.
You could also use nested, weighted
LinearLayouts
:How to set layout_weight attribute dynamically from code?
There might be warnings about it being "slow" - but with this type of situation, it's unlikely to be noticeable.