In my Android app, I want to display a table of 5 rows and 4 columns, each equally sized to fill the screen. I have a TableLayout; inside of that are five TableRows. The first four TableRows each have four Buttons; the fifth TableRow has four clickable ImageViews. All 20 objects have layout_height MATCH_PARENT and layout_weight 1. The problem is, the four ImageViews' images are 400x400, so when the screen is generated, the columns are sized correctly, but the bottom row takes up most of the screen (and the images are stretched way out of proportion vertically). I don't know the size of the screen in advance, so I can't hard-code the height.
I would prefer not to have to set the ImageViews' heights in code, as there is a lengthy (about 10 seconds - similar to what you go through when you start up The Simpsons Tapped Out) initialization step and I have problems if the screen is not displayed while the initialization is taking place. Is there a way to get the five rows to match heights in the layout XML?
No comments:
Post a Comment