Re: [android-developers] ActionBar Tabs with multiple fragments
On Thu, Feb 9, 2012 at 12:36 PM, Jason Prenger <jasonmprenger@gmail.com> wrote:
> but how do I have
> more than one fragment in a tab?
The same way you have more than one fragment anywhere else: put more
than one in a container (e.g., two FrameLayouts in a LinearLayout).
> I can convert the second layout to using tabs since its only contains
> one fragment but I'm not sure how get the first layout into a single
> tab. Is that something that's allowed?
Sure. An action bar tab is a button. It dictates nothing about what
happens when a tab is clicked.
Off the cuff, I'd have a LinearLayout with three FrameLayout children.
When the first tab is chosen, load your three fragments in the three
FrameLayouts. When the second tab is chosen, load your one fragment in
one of the FrameLayouts and make the others have visibility of GONE.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
Android Training...At Your Office: http://commonsware.com/training
--
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
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home