askanaan
askanaan

Reputation: 197

Specifying imageView to resize as percentage of screen

In Android I need to have a simple layout to be designed using XML layout (rather than programming):

I need to have the following :

1- small image view on the left (centered vertically)

2- Three image views a bit larger beside each others (also centered vertically)

3- Small image view on the right side (centered vertically)

so the 5 images are adjacent horizontally and centered vertically.

This is simple, anyhow the question is how to specify the image views to resize as percentage of the screen height ?

So if I specify the three image items to be 60% of screen height, I expect the imageView to resize (including the source image) to be 60% of screen height.

Is it achievable?

Thanks

Upvotes: 4

Views: 8687

Answers (1)

Anuj
Anuj

Reputation: 2073

Yes, it is, Take a LinearLayout(Horizontal) and then to all the childs(Imageviews here) give layout:height="0dp" and layout:weight=".6" , try this first and update questions if you have any further

Upvotes: 2

Related Questions