You would perhaps have to re-draw the view heirarchy, at-least it's
immediate parent.

-Kumar Bibek
http://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

Reply via email to