Measure height of view with new LayoutParam

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Measure height of view with new LayoutParam

Postby sandis84 » Mon Nov 23, 2009 11:40 am

So I have a view that I give a new layoutparam. Then I want to measure the height it gets with this new layoutparam. My code is like this:


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. RelativeLayout.LayoutParams layoutParam = new RelativeLayout.LayoutParams(
  2.  
  3. LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
  4.  
  5. layoutParam.addRule(RelativeLayout.BELOW, R.id.title);
  6.  
  7. layoutParam.addRule(RelativeLayout.ABOVE, R.id.bottom_menu);
  8.  
  9. scroller.setLayoutParams(layoutParam);
  10.  
  11. scroller.getHeight();
  12.  
  13.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


The problem is that the height has not changed yet when I call the getHeight-function. I want to measure the height immediately after it changes. How do I do?

Cheers,
Per Sandström
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests