Android UINavigationController-like feature

后端 未结 4 978
梦如初夏
梦如初夏 2021-02-02 09:42

On the iPhone I use a Navigation Controller to push and pop Views from. Very handy.

Is there an equivalent in Android?

4条回答
  •  鱼传尺愫
    2021-02-02 10:17

    This is an old question, but I believe the answer has changed. It is now possible to imitate the Nav stack in iOS in android using Fragments. http://developer.android.com/reference/android/app/Fragment.html

    Basically instead of jumping from Activity to Activity you instead stay in one Activity that controls the display, organization, and animation of Fragments which each contain their own behavior much like the NavController / UIViewController model in iOS.

    It is also backwards compatible as a static library so you can implement it on pre-Honeycomb devices. Strategies for Honeycomb & backward compatibility

提交回复
热议问题