iPhone开发教程之处理常见任务(3).ppt_第1页
iPhone开发教程之处理常见任务(3).ppt_第2页
iPhone开发教程之处理常见任务(3).ppt_第3页
iPhone开发教程之处理常见任务(3).ppt_第4页
iPhone开发教程之处理常见任务(3).ppt_第5页
已阅读5页,还剩11页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、iPhone开发教程之处理常见任务(3),处理方向变化 使用声音 提供选择 列表(即表格视图) 选取器 开关控件 提供许可协议,Users can rotate iPhone OSbased devices at any time, and they expect the content theyre viewing to respond appropriately. In your iPhone application, be sure to: 用户随时可能旋转搭载iPhone操作系统的设备,同时他们也期望当前浏览的内容能随之响应适当的调整。在你的iPhone应用程序中,一定要: Be aw

2、are of accelerometer values (for more information on the accelerometer and references to accelerometer programming interfaces, see iPhone Application Programming Guide). If appropriate, your application should respond to all changes in device orientation. 要注意加速度值(要了解更多关于加速度和有关编程接口的参考信息,参见iPhone应用程序编

3、程指南)。如果合适,你的应用程序应对设备所有的方向变化作出响应。,iPhone开发教程之处理方向变化,If theres a part of your applications user interface that displays in one orientation only, its appropriate for that area to appear in that orientation and not respond to changes in device orientation. For example, when a user selects an iPod video

4、to view, the video displays in landscape orientation, regardless of the current device orientation. This signals the user to physically rotate the device to view the video. The important point about this example is that iPod does not provide a “rotate now” button; instead, the user knows to rotate t

5、he device because the video appears in landscape orientation. 如果你的应用程序中某些用户界面只能在一个方向显示,合理的办法是,让它保持在指定方向的显示,而不必响应设备的方向变化。例如,当用户选择观看一个iPod视频,不论当前的设备是什么方向,它都横向显示。这就暗示用户要旋转设备,以便于观看视频。在这个例子中重要的一点是,iPod没有提供“旋转”按钮,而是用户知道要旋转设备,因为视频横向显示。,iPhone开发教程,Allow users to physically rotate the device to correctly vie

6、w the parts of your applications user interface that require a specific orientation. Avoid creating a control or defining a gesture that tells users to rotate the device. 允许用户旋转装置以便于正确察看你的应用程序中,那些需要一个明确方向的用户界面。避免为了告诉用户旋转设备而去创建一个控件或定义一个行为。,iPhone开发教程,Take advantage of the one-step orientation-change

7、process to perform smoother, often faster rotations. However, if your screen layout is very complicated, you might choose instead to perform a cross-fade transition when an orientation-change occurs. To learn how to support the one-step process in your code, see UIViewController Class Reference. 充分利

8、用一步到位的方向改变进程,顺畅,快速地执行旋转。然而,如果你的屏幕布局很复杂,当方向发生变化时,你可以选择淡入淡出的过渡这种方式替代。要了解如何在你的代码中支持这个步骤,参见“UIViewControllerClass”参考。,iPhone开发教程,Users often rotate their devices to landscape orientation because they want to “see more.” If you respond by merely scaling up your content, you fail to meet users expectation

9、s. Instead, you should respond by rewrapping lines of text and, if necessary, rearranging the layout of the user interface so that more content fits on the screen. 用户经常旋转自己的设备至横向,因为他们希望“看到更多”。如果您只是以比例放大内容的方式响应用户,那就未能达到用户的期望。相反,你应该重新调整文本的换行线,有必要的话,重新安排用户界面的布局,以便让更多的内容显现在屏幕上。,iPhone开发教程,Users expect g

10、reat sound from iPhone OSbased devices, whether theyre hearing system sounds, such as ringtones and alert sounds, or application sounds, such as media playback, ambient sounds, and soundtracks. In addition, users expect sounds from their devices to obey both their preferences and their intentions. 用

11、户期望从搭载 iPhone 操作系统的设备听到美妙的声音,无论他们在听系统声音,如铃声和提醒声音,或应用程序声音,如媒体播放,环境声音,以及音轨。此外,用户也希望设备发出的声音符合他们的预设和意愿。,iPhone开发教程之使用声音,Users decide how loud sounds should be and whether they want to hear them at all. Sometimes, however, users expect to hear certain sounds even when their current settings indicate that

12、 they prefer silence. For example, users always expect to hear alarms that they have set. Essentially, users want to hear sounds they ask for, but avoid hearing sounds they dont ask for. 声音的大小与是否播放,完全是由用户决定的。但是,有的时候,尽管用户目前的设置说明他们更希望处于静音模式,但是用户还是希望听到某些声音。例如,用户总是希望听到他们设置的提醒声。从本质上讲,用户是想听到他们需要的声音,但不想听到他

13、们不需要的声音。,iPhone开发教程,To help you accommodate this, iPhone OS provides programming interfaces you can use to: 为了帮助你适应这种情况,iPhone操作系统提供了以下编程接口,你可以使用: Describe how your applications sounds should fit in with other sounds on the device 描述你的应用程序的声音应该如何与设备上的其他声音相协调 Ensure that your applications sounds play

14、 according to users expectations 确保你的应用程序的声音是根据用户的期望在播放,iPhone开发教程,Before you decide how to handle sound in your application, you need to understand how users expect applications and the device to behave when they adjust device controls and use external devices, such as headphones and headsets. 在你决定

15、如何处理应用程序中的声音前,你需要了解,当用户在调整设备控制选项和外部设备的时候,他们是期望应用程序和设备应该如何表现他们的。调整控制和使用外部设备,如耳机和耳麦。,iPhone开发教程,iPhone OS includes a few elements that help users make selections. When you need to offer choices in your application, you should use these selection methods because users are already familiar with their be

16、havior. In general, you should not try to replicate the appearance and behavior of selection controls you might see in a desktop computer application, such as an application menu or a set of radio buttons. iPhone OS provides the following elements you can use to offer choices to users: iPhone 操作系统包含

17、了一些界面元素提供给用户作出选择。当当你需要在应用程序里提供选择时,你应该提供这样选择方式,因为用户已经很熟悉(这些方式)的行为。一般来说,你不应该把桌面应用程序的选择控件的外观和行为直接复制过来,比如应用程序菜单或者一组单选按钮。iPhone OS 提供以下界面元素供你使用至给用户提供选择:,iPhone开发教程之提供选择,Lists (that is, table views). Users tap a row in a list to select an item. Lists are suitable for displaying almost any number of choice

18、s. For details on the ways you can use table views in your application, see “Table Views.” 列表(即表格视图)。用户点击列表里的一行来选择一个项目。列表几乎适用于展示任何数量的选择。关于在应用程序里如何使用表格视图的具体内容,参见“表格视图”。,iPhone开发教程之列表(即表格视图),Pickers, including date and time pickers. Users spin the wheels in a picker until each wheel displays the desir

19、ed part of a multipart value, such as a calendar date that comprises year, month, and day. For more information about using pickers in your iPhone application, see “Date and Time Pickers” and “Pickers.” 选取器,包括日期和时间选取器。用户拨动选取器内的滚轮,直到每个滚轮都显示了期望的那个组合的数值,比如一个日期组合包含年,月,日的数值。关于在iPhone应用程序里如何使用选取器的更多信息,参见“

20、日期时间选取器”和“选取器”。,iPhone开发教程之选取器,Switch controls. Users slide a switch control from one side to the other, revealing one of two values. A switch control is intended to offer a simple choice within a list. For more information about switch controls, see “Switch Controls.” 开关控件。用户将开关控件从一端滑动到另外一端,表示选择两个值

21、中的一个。开关控件是用来在列表中提供简单选择的。关于开关控件的更多内容,参见“开关控件”。,iPhone开发教程之开关控件,Sometimes, an application requires users to accept a license agreement before they can begin using the application. Such an agreement (often called an end-user license agreement, or EULA) usually contains various terms and conditions that can describe liability limits and govern usage. If you provide a license agreement with your iPhone application, be aware that the App Store displays it, so that people can read it before they get your application. 有的时候,应用程序会要求用户在接受了许可协议后才可开始使用。这种协议(常被称作最终用户许可协议,或者EU

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论