学习使用Fragment。
1,Fragment是什么?
为了让界面可以在平板上更好地展示,Android在3.0版本引入了Fragment(碎片)功能,它非常类似于Activity,可以像 Activity一样包含布局。
2,Fragment有什么用?
为了满足平板等大屏显示。
3,怎么使用Fragment?
All subclasses of Fragment must include a public no-argument constructor. The framework will often re-instantiate a fragment class when needed, in particular during state restore, and needs to be able to find this constructor to instantiate it. If the no-argument constructor is not available, a runtime exception will occur in some cases during state restore. 所有Fragment子类必须包含一个公共的无参构造器。当系统需要的时候,Fragment子类经常都要重新实例化对象,特别是在状态恢复期间,需要能够找到这个构造器来实例化它。
本文介绍了Fragment的概念及其在Android应用开发中的作用。Fragment类似于Activity,可以包含布局,并有助于改善应用程序在大屏幕设备上的显示效果。所有Fragment子类必须提供一个公共无参构造器以便系统在需要时进行实例化。

1560

被折叠的 条评论
为什么被折叠?



