Thank you!
I inserted:
final ViewGroup boxView = ( ViewGroup )
findViewById(R.id.relBox );
boxView.invalidate();
relBox is the relativeView holding the image. So that's the immediate
parent. This did not fix the problem.
is invalidate() the right way to redraw?
Best,
Saied
On Oct 5, 12:00 am, Kumar Bibek <[email protected]> wrote:
> You would perhaps have to re-draw the view heirarchy, at-least it's
> immediate parent.
>
> -Kumar Bibekhttp://techdroid.kbeanie.com
>
> On Oct 5, 11:17 am, Saied <[email protected]> wrote:
>
> > Hi,
>
> > This looks too simple, but I can't figure out why it does not.
>
> > I have an ImageView inside a relative layout:
>
> > <ImageView
> > android:id="@+id/DRAG"
> > android:layout_height="10dip"
> > android:background="@drawable/drag_stroke"
> > android:layout_centerHorizontal="true"
> > android:layout_centerVertical="true"
> > android:layout_width="10dip">
> > </ImageView>
>
> > In the code, I would like to change it's width: (in response to the
> > change of a seekBar)
> > Here's the code:
>
> > private void setWidthOfImage(imageWidthInPixel){
> > final ImageView dragView = ( ImageView )
> > findViewById(R.id.DRAG );
> > dragView.getLayoutParams().width = imageWidthInPixel ; //
> > ******** this does not execute****
>
> > }
>
> > It works only once (when called at initialization). but the same code
> > called again, from inside the loop of seekBar, enters with the correct
> > value, but does not execute the getLayoutParams statement.
>
> > The seekBar correctly updates and provides the correct value. Inside
> > setWidthOfImage I can read the value to be correct. But the width does
> > not get updated.
>
> > Can a good soul shed light on this?
>
> > Thank you
>
> > Saied
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en