开发者

Empty View to add any Content on it

I'm creating an application and it's has a button to switch perspective view of the itens (coverflow, grid and list). My question was, how do I keep an space in my activity to swap these view开发者_如何学Gos?

I have a header, and a footer, the middle I want to place an empty View in that to switch my perspectives on it.

Someone has a better idea?


You should use something like ViewFlipper if I understand you right. Even better you can define your children Views as includes or stubs


I didn't really understand your question.

Are you looking for a ViewStub?

http://developer.android.com/reference/android/view/ViewStub.html

You can inflate layouts to a ViewStub. But you can do it to any "ViewGroup" like LinearLayout etc.

The advantage is that a "ViewStub is an invisible, zero-sized View that can be used to lazily inflate layout resources at runtime". It's really there for it.

Inflating "normal" layouts may have additional costs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜