Dynamic UI with sliding menu and actionbarsherlock

后端 未结 3 1563
再見小時候
再見小時候 2021-02-01 11:14

Trying to achieve a dynamic UI with facebook like sliding menu and actionbarsherlock .First i have look into android documentation which introduce fragment to handle dynamic but

3条回答
  •  情深已故
    2021-02-01 11:25

    My problem is how do i include this 3 fragment into my homescreen ?

    It really depends on how do you want them to behave.

    Do you want them to appear only one at a time without allowing swipeing between them? If yes then add/insert a container layout(for example a simple FrameLayout) in your Activity on which you'll add the Fragments. I didn't worked with the SlidingMenu library but it should have a callback called when you click one of the items in the menu. In that callback you'll attach the proper fragment to the container layout(the FrameLayout) I mention earlier.

    Do you want to show only one Fragment but you want to allow the user to swipe between them? If yes use a ViewPager in the activity layout and in the callback triggered by the SlidingMenu library's menu selection set the current page of the ViewPager with the setCurrentItem() method.

    If you want something different then this provide more details.

    Most tutorial are creating fragment with code, i just want to include my 3 task into it

    This, I don't quite understand. If you want to "include" your task fragments directly in your xml layout, you can but you'll be limited on what you can do with them(not to mention that all the fragments will be on one single screen) and I would avoid it. If you want something else provide more details.

提交回复
热议问题