标签:
To create a dynamic and multi-pane user interface on Android, you need to encapsulate UI components and activity behaviors into modules that you can swap into and out of your activities. You can create these modules with the Fragment
class, which behaves somewhat like a nested activity that can define its own layout and manage its own lifecycle.
Learn how to build a fragment and implement basic behaviors within its callback methods.
Learn how to build your app with layouts that provide different fragment configurations for different screens.
Communicating with Other Fragments
Learn how to set up communication paths from a fragment to the activity and other fragments.
用Fragment创建一个灵活的UI
在Android上为了实现一个灵活的、多窗口的交互界面,你可以创建一些Fragment将UI界面和在Activity中的相关操作封装成相应模块,以便在你的activity中可以自由切换。在某些地方,它就像一个嵌套的Activity,比如可以自定义布局和拥有自己的生命周期。
课程目录
学习如何创建一个fragment,以及实现其生命周期内的基本功能。
学习在APP内,对不同的屏幕尺寸用fragment构建不同的布局。
学习fragment与activity及其他fragment间进行交互。
你需要必看的内容
你可以选看的内容
完整的Demo示例:FragmentBasics.zip
部分翻译来自
标签:
原文地址:http://www.cnblogs.com/404map/p/5224718.html