开发者

Android - switching between listviews without changing the layout?

开发者 https://www.devze.com 2023-01-24 05:41 出处:网络
I\'m not looking for exact code here, just a direction on what to look for and what I should be reading about so I can figure this out.

I'm not looking for exact code here, just a direction on what to look for and what I should be reading about so I can figure this out.

I have a layout that I would like to remain static, with only the listview changing depending on what's selected from the list. I've reloaded data in the list, but I would like the fancy transition animations between choices, and would like the app to go to the previous menu when pressing back.

Someone suggested using a viewswitcher, which seems like it'd be great, but I am still unsur开发者_运维技巧e about how to fill a listview in a layout with a regular row layout, then on selection do an animated transition to a custom row. Also, it seems the viewswitcher is limited to two views, so it may be a limitation when I want to go a few menus deeper.

Preferably, I'd like to put each menu in it's own class so that I can handle filling it in that class, if possible...

Hope this isn't too vague, but if it is I'll be more than happy to explain myself further.


Don't know if it's what you meant but have you tried showing and hiding the views?

findViewById(R.id.listViewID).setVisibility(LinearLayout.GONE); //hide the one you want
findViewById(R.id.listViewID2).setVisibility(LinearLayout.VISIBLE); //show the one you want

Hope it's what you meant :)

0

精彩评论

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

关注公众号