iphone:Segmented-controls
出自UXGuide.net
请帮助我们修订和更新本文的译文部分
本文的译文部分可能是由多个贡献者提供或从不同的渠道收集,未经过最终审阅和整理,请您帮助我们一起修订和更新本文的译文部分。
分段控件
Segmented Controls
A segmented control is a linear set of segments, each of which functions as a button that can display a different view. When users tap a segment in a segmented control, an instantaneous action or visible result should occur. For example, Settings displays different information when users use the segmented control to select an email protocol, as shown in Figure 9-11.
分段控件是一套线性segment,每个segment起到按钮的作用,以显示不同的视图。当用户点击分段控件中的一个segment时,一个瞬时行动或有形的结果应该发生。例如,当用户使用分段控件选择一个电子邮件协议时,设置显示不同的信息,如图9-11。
Figure 9-11 A segmented control with three segments
图9-11 包含三个segment的分段控件
The length of a segmented control is determined by the number of segments you display and by the size of the largest segment. The height of a segmented control is fixed. Although you can specify the number of segments to display, be aware that users must be able to comfortably tap a segment without worrying about tapping a neighboring segment. Because hit regions should be 44 x 44 pixels, it’s recommended that a segmented control have five or fewer segments.
一个分段控件的长度取决于你显示的segment的数量,以及最大的那个segment。一个分段控件的高度是固定的。你可以指定显示的段数,但是要注意,用户必须能够很舒适地点击而不用担心错误的点击了周边的segment。由于被点击的区域应为44 × 44像素,建议分段控件所包含的segments不超过5个。
A segmented control can contain text or images; an individual segment can contain either text or an image, but not both. In general, it’s best to avoid mixing text and images in a single segmented control.
分段控件可以包含文字或图像,个体的segment也可以包含文字或图片,但不能同时包含两者。一般来说,最好避免在一个分段控件混合使用文本和图像。
A segmented control ensures that the width of each segment is proportional, based on the total number of segments. This means that you need to ensure that the content you design for each segment is roughly equal in size.
分段控件能确保每个segment的宽度成比例,取决于总的segments数量。这意味着你需要确保你的内容和每一个segment的设计大小基本一致。
To learn more about using a segmented control in your code, see UISegmentedControl Class Reference.
要了解更多有关在代码中使用分段控件的信息,请参阅 UISegmentedControl 类型参考。