4. Building a Dynamic UI with Fragments 使用片段构建动态UI

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.

要在Android上创建一个动态和多窗格的用户界面,您需要将UI组件和活动行为封装到可以插入和移出活动的模块中。 您可以使用Fragment类创建这些模块,其行为有点像可以定义自己的布局并管理自己的生命周期的嵌套活动。

When a fragment specifies its own layout, it can be configured in different combinations with other fragments inside an activity to modify your layout configuration for different screen sizes (a small screen might show one fragment at a time, but a large screen can show two or more).

当片段指定自己的布局时,它可以配置为与活动中的其他片段不同的组合,以修改不同屏幕大小的布局配置(一个小屏幕可能一次显示一个片段,但是大屏幕可以显示两个或 更多)。

This class shows you how to create a dynamic user experience with fragments and optimize your app's user experience for devices with different screen sizes, all while continuing to support devices running versions as old as Android 1.6.

该课程向您展示如何创建具有片段的动态用户体验,并针对具有不同屏幕尺寸的设备优化应用的用户体验,同时继续支持运行与Android 1.6相同版本的设备。

转载于:https://www.cnblogs.com/youseiraws/p/7025661.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值