Ok, I'm working on a custom view and having trouble with setting its size so 
it scales properly across devices.

In particular i want its fixed height to be relative to its width (of 
match_parent).

Something like this sudo code:

   View myview = new View(..);

myview.setLayoutParams(new LayoutParams(

  LayoutParams.MATCH_PARENT, (MATCH_PARENT / 4) * 3));


The goal would be to make the component height be 3/4's of the width.


This doesn't have to be done from outside. i.e. it could be done from inside 
the view, but I'm unsure what I need to override inside my 
view implementation to set the height. Set it too early and i may not yet 
have my width, set it to late and I may just end up on a resize race loop :)


So, my question is, what is the proper way to make a View dynamically sized 
at runtime in at least one of the dimensions?


- Brill Pappin





-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to