Friday, May 27, 2011

[android-developers] Can't modify attributes of child in ViewAnimator

I have a ViewAnimator subclass with two children, and I want to modify
the size of the second child at runtime. However, setting the width
prevents the second child from getting displayed at all. My code looks
something like this:

setDisplayedChild(1);
View view = findViewById(R.id.second_view);
view.setWidth(500);

Removing the line where I set the width results in the second child
getting shown, so the ViewAnimator itself seems fine. I've also tried
adding an AnimationListener, but the resulting behavior is erratic.

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment