Skip to content Skip to sidebar Skip to footer

AddView Not Visible In Custom FrameLayout But Clickable

I wanted to create a relatively generic ViewGroup container to have it switch to a progressbar and hide it again (+switch to content) when the loading task is ready. This should be

Solution 1:

instead of creating your own custom view just for switching views, why not use ViewSwitcher instead?

the way it works is that you put 2 views inside the viewSwitcher, one is prbably the progressBar (or a layout that holds it and maybe a textView) , and the other one is the content itself.

when you are ready to do the switching , you can use viewSwitcher.showNext() .

in order to be sure the correct view is shown, you can check what is returned from getCurrentView() .


Post a Comment for "AddView Not Visible In Custom FrameLayout But Clickable"