KyleStew
KyleStew

Reputation: 420

How do you do your dynamic layouts?

I want to dynamically hide/show controls in an activity based on a button touch event: when the user presses the "details" button, I want to show more controls in the same activity.

What is the best way to handle this? Is there a way to do TextView.Hide()? Can it animate the transition?

Upvotes: 1

Views: 556

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006744

setVisibility() will allow you to make a widget visible, invisible, or gone. The difference between the latter two is that an invisible widget still takes up space, while a widget that is gone does not.

Android has an entire animation framework for slides, fades, spins, and the like. Here are two sample projects showing some of this.

Upvotes: 9

Related Questions