Link to home
Start Free TrialLog in
Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on

how to get the height and widht of the views in an android activity in pixels

HI,
I have an activity running on my android phone. Each view is having some pixels width and height on the phone screen. I want to find out how much height and width in pixels on the phone screen does each view take. How can i find out this ?

Thanks
SOLUTION
Avatar of Flora Edwards
Flora Edwards
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rohit Bajaj

ASKER

Hi,
That will give me view height and width. what if there is a background drawable in the view... Although i can find out the width and height in pixels for this drawable image on my computer. But when this will be rendered on my mobile its width and height may vary. How do i find out the exact width and height on my android phone
not sure if i understood your question correctly.

are you trying for multiple screen support?  here is the useful andriod developer best practice link
https://guides.codepath.com/android/Working-with-the-ImageView

http://developer.android.com/guide/practices/screens_support.html
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial