Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Layout-sw600dp

 
Fleurtje Eliza
Greenhorn
Posts: 9
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!

I am racking my brain, but I don't get it. I want to use a special layout for tablets to get the images of my app bigger. Right now both my phone and tablet are mdpi and therefore the sizes of the images the same. Which looks ridiculous on a 600x1024 tablet. But somehow I don't get the images shown bigger.

When the code as you can see below is not wrap content, but match parent the images are so big that the two lines of information (name plus size of the image/art work) that go with it falls of the screen. Therefore I tried wrap content combined with the minimal width, but the images are still there original size.

Any suggestions? Thank, Fleur

 
Swastik Dey
Rancher
Posts: 1639
6
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably need to scale the image dynamically with maintaining the aspect ratio.
 
Fleurtje Eliza
Greenhorn
Posts: 9
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply, Swastik. But I am not sure I understand it... do you mean I should fix this not in the xml file? Please, could you be more specific to get me going?

Thank you, Fleur
 
Swastik Dey
Rancher
Posts: 1639
6
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Fleurtje Eliza
Greenhorn
Posts: 9
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow Swastik, thanks so much for this example!! I was afraid that indeed it wouldn't be just a simple xml sw600dp file... Now I know where to start.

Ciao, Fleur

PS - I need some time to study this, because this needs to go with my viewpager activity. So mods, please don't close this topic yet.
 
Swastik Dey
Rancher
Posts: 1639
6
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic