• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help in Understanding View.onSizeChanged()

 
zoheb hassan
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys can anyone help me in understanding this method with an example where it is absolutely necessary to use this method,I tried using docs and forums but not getting an clear idea about this.Any examples or tutorials would be highly helpful

Thanks
Zoheb
 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zoheb when we create our own View, we can override this method to know the size of our View i.e. the area in which its being displayed. When our view is first initialized, the constructor is called but at that time you don't know the area available to your view. This method is called before the onDraw method so that you know how much area is available to your view so that you can draw everything in that area...
 
zoheb hassan
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ankit Thanks for the reply can you provide some code where you have used this,I just want to understand it better
 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this android game tutorial...
 
zoheb hassan
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ankit Checked the tutorial the things are clear now and the game is awesome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic