Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I create a social networking app https://github.com/dingdangmao123/weico I want to compress the photo, so I need to get the width and height of ImageView,but getwidth() and getHeight() is 0. What should I do ?

What I have tried:

I set the fixed value like 150
Posted
Updated 14-Mar-18 5:13am

1 solution

Use the debugger to look at the ImageView directly while your code is running - I'm guessing it isn't the one you think it is, and it doesn't contain any image at all.
But I'm not wading through your entire project trying to work out where in that code you are doing what - if you want specific answers, you need to show relevant code fragments instead of dumping your code on us and saying "I can't be bothered to help you, so you help me instead."

The better your question - i.e. the more effort you put into it - the better our answers can be. But just dumping code and expecting us to wade through it is just rude and that doesn't make you any friends...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900