EditText and Canvas View are both created in the FrameLayout's C'tor (sorry i forgot to to mention it's my own class inheriting from FramLayout and not the original). The first LAyoutParams i give EditText are w:0 h:0 x:0 y:0, each time on resize is called and the item that the EditText is bounded to changes it's size i take that size and set it in the margins and width and height of the layoutParams. The FramLayout is created in onCreate and added with setContentView()
On Feb 18, 12:26 pm, skink <psk...@gmail.com> wrote: > On Feb 18, 10:43 am, poohtbear <eyaltg...@gmail.com> wrote: > > > > > the hirarchy ? > > It's created in runtime > > > FramLayout > > | > > -------------CanvasView(extends view) - responsible for drawing > > our UI, overrides onSizeChanged and onDraw. > > | > > ------------- EditText, used for binding our UI's focused > > textFields to android's. > > > So when resize happens: > > 1. FrameLayout onMeasure is called. > > 1.1 CanvasView onMeasure is called. > > 1.2 EditText onMeasure is called <-- problem since new LayoutParams > > are not set yet! > > 2. onLayout called on FrameLayout <-- here the FramLayout will use the > > meausredWidth of Edit Text to lay it out.But the size is wrong > > 3. onSizeChanged is called on FrameLayout and CanvasView <--- here the > > new LayoutParams are set for EditText. > > > what i need is step no 4: cause onMeasure to be called again, at least > > on EditText and onLayout for FrameLayout, can't manage to do it. > > ok, when at runtime, you create EditText, how you add it to > FrameLayout? > > i mean what LayoutParams does your EditText have? > > pskink -- 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