版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、iPhone開發(fā)教程之處理常見任務(wù)(2),啟用推送通知通知的類型標(biāo)記類型聲音類型提醒類型使你的程序具有無障礙性重要提示提供搜索功能并顯示搜索結(jié)果利用用戶的位置,When you register your application with Apple Push Notification Service, you can arrange to alert users when new data arrives, even
2、if your application isn’t running. When a device receives a message for an application that isn’t running, it can notify the user by: 當(dāng)你為你的應(yīng)用程序注冊蘋果推送通知服務(wù)時后,當(dāng)接收到新的數(shù)據(jù)后,即可安排提醒予以用戶(提醒新數(shù)據(jù)),即使你的應(yīng)用程序沒有運行。當(dāng)設(shè)備接收到某個未運行應(yīng)用程序的信息時,它可
3、以這樣通知用戶:,iPhone開發(fā)教程之啟用推送通知,Updating a badge on the application’s Home screen icon在應(yīng)用程序的主屏幕圖標(biāo)上顯示徽章 Playing an alert sound播放提醒聲 Displaying an alert message顯示一個提醒信息 or some combination of these. The user might respond
4、 by starting the application to manage the new data or merely acknowledging its arrival. (To learn how to handle push notifications in code, see Apple Push Notification Service Programming Guide.) 或者任意組合上述的通知方式。用戶對通知的反應(yīng)
5、可能有,啟動此應(yīng)用程序去管理一下新數(shù)據(jù),或者只是了解通知的到達(而不采取任何操作)。(要了解如何用代碼處理推送通知,參見蘋果推送通知服務(wù)編程指南。),iPhone開發(fā)教程,Note: Delivery of push notifications is not guaranteed. Also, users can refuse to receive notifications system-wide. Push notific
6、ations are intended to notify users of new data, not to deliver critical data to your application. 注意:推送通知的發(fā)送不是有保證的。同時,用戶可以全系統(tǒng)地拒絕接收通知。推送通知的目的是通知用戶有新數(shù)據(jù),并不會向你的應(yīng)用程序?qū)懭胫匾獢?shù)據(jù)。,iPhone開發(fā)教程,The Notifications section in the built-
7、in Settings application hosts push notification settings for every application that registers for the Apple Push Notification Service. For each application, iPhone OS provides settings for users to allow or disallow badg
8、ing, sounds, and alert messages. 內(nèi)置的設(shè)置應(yīng)用程序中的通知設(shè)置部分主導(dǎo)著推送通知的設(shè)置,它對每個注冊了蘋果推送通知服務(wù)的應(yīng)用程序都提供了設(shè)置。對于每個應(yīng)用程序,iPhone操作系統(tǒng)都提供給用戶允許或不允許,標(biāo)記,聲音,提醒的三種方式的通知。,iPhone開發(fā)教程,Take some time to think about the types of events for which users woul
9、d appreciate notification. A notification should give users useful, actionable information they want to receive, even when they’re not using your application. 請花一些時間想想什么類型事件的通知是用戶希望的。通知應(yīng)給予用戶那些有用的,可付諸操作的信息,即使他們沒有使用你的應(yīng)用程序
10、。,iPhone開發(fā)教程,After you’ve identified the events your users are likely to care about, you should also allow users to decide which events should generate what type of notification, if any. If you don’t allow users to custo
11、mize the push notification experience in your application, you’re liable to pester users with notifications they’re not interested in. 當(dāng)你已經(jīng)確定應(yīng)用程序的哪些事件用戶可能會關(guān)心之后,如果有的話,你也應(yīng)該允許你的用戶決定哪些事件使用什么類型的通知。如果你不允許用戶自定義應(yīng)用程序中的推送通知的體驗,你就
12、容易讓用戶陷入與他們不感興趣的通知的糾纏之中。,iPhone開發(fā)教程,Users can choose which types of notifications they want to receive, so you should support all three types: 用戶可以選擇他們想要接受哪些類型的通知,所以你應(yīng)該支持所有三種類型:,iPhone開發(fā)教程之通知的類型,Badge. Badging is the lea
13、st intrusive way to tell users that there is new content they might be interested in. The badge is a small red oval that appears over the upper-right corner of your Home screen icon. You do not have any control over the
14、appearance of the badge and it contains only numbers, not letters or punctuation. 標(biāo)記。標(biāo)記是打擾程度最小的方式告知用戶有新的他們感興趣的內(nèi)容。標(biāo)記出現(xiàn)是在主界面應(yīng)用圖標(biāo)右上角的一個紅色小橢圓。你不能對標(biāo)記的出現(xiàn)做任何控制,它只包含數(shù)字,沒有字母和標(biāo)點。,iPhone開發(fā)教程之標(biāo)記類型,Badging works well when you want t
15、o tell users how many items are waiting for their attention. For example, the number in a badge might indicate unread messages, newly assigned tasks, or how many remote players are currently playing a game. 當(dāng)你想要告訴用戶有多少通
16、知項在等待他們的注意時,標(biāo)記很有效。例如,在一個標(biāo)記里數(shù)目可能會顯示未讀消息,新分配的任務(wù),或者是當(dāng)前遠程參與者。,iPhone開發(fā)教程,Sound. You can supply a custom alert sound, or you can use a built-in alert sound. If you create a custom sound, be sure it is short, distinctive, and
17、professionally produced. (To learn about the technical requirements for this sound, see “Preparing Custom Alert Sounds” in Apple Push Notification Service Programming Guide.) Note that you cannot force the device to vibr
18、ate when a notification is delivered; the user has control over whether alerts are accompanied by vibration. 聲音。你可以提供一個自定義提醒聲音,也可以使用內(nèi)置的提醒聲。如果你創(chuàng)建一個自定義的聲音,請確保它是短暫的,獨特的,專業(yè)化制作的。 (要了解有關(guān)這個聲音的技術(shù)要求,在蘋果推通知服務(wù)編程指南中參見“準(zhǔn)備自定義提醒聲音”。)請
19、注意你不能強迫設(shè)備發(fā)出通知時振動;應(yīng)該由用戶控制是否警告伴隨振動。,iPhone開發(fā)教程之聲音類型,An easily recognized sound is ideal for situations in which the notification arrival itself provides enough information for users to act. For example, a collaborative tas
20、k management system might use a unique sound to accompany the completion of a member’s assignment. Merely hearing this sound tells the user that the assignment has been completed. 在通知到達的時候,提供一個容易識別的聲音是十分理想的選擇,因為它提供足夠的信息
21、給予用戶反應(yīng)。例如,一個用于多人協(xié)作完成任務(wù)的管理系統(tǒng),可以使用一個獨特的聲音,伴隨成員任務(wù)的完成。僅僅聽到這個聲音,用戶就會知道已經(jīng)完成了任務(wù)。,iPhone開發(fā)教程,Alert. An alert is the most intrusive way to notify users of new content. An alert displays your application name at the top, your mess
22、age below that, and one or two buttons at the bottom. If you specify two buttons, the alert displays the Close button on the left and the View button on the right (users can tap the View button to simultaneously dismiss
23、the alert and launch your application). If you specify one button, the alert displays an OK button. The Close button and the OK button both dismiss the alert without opening your application. 提醒。提醒是打擾程度最大的通知用戶有新內(nèi)容的方式。在提
24、醒的上方顯示你應(yīng)用程序的名稱,下方顯示的是信息,底部有一至兩個按鈕。如果你指定兩個按鈕,應(yīng)在左側(cè)顯示關(guān)閉按鈕,右側(cè)顯示查看按鈕(用戶可以通過點擊查看按鈕,關(guān)閉該提醒同時并啟動應(yīng)用程序)。如果你指定一個按鈕,提醒只顯示一個確定按鈕。關(guān)閉按鈕和確定按鈕的作用都是關(guān)閉提醒,并且不打開應(yīng)用程序。,iPhone開發(fā)教程之提醒類型,Alerts interrupt the user’s workflow, so they’re best used
25、sparingly to deliver a short, important message about an event. In particular, be sure to avoid including any advertising content in your alert message. 提醒會干擾用戶的工作流程,因此最好少用他們,除非是用來為你提供有關(guān)事件簡短的,重要的信息。尤其是,一定要避免提醒消息中的包含任何廣告
26、內(nèi)容。,iPhone開發(fā)教程,An application is accessible when users with disabilities can use it successfully, perhaps with the help of an assistive application or device. iPhone OS–based devices include many features that make it ea
27、sier for all users, including disabled users, to use the device, such as visual voicemail, zoom, and voice control. You do not have to take any steps in your application to ensure that your users can benefit from these f
28、eatures. 無障礙性指的是應(yīng)用程序應(yīng)該讓殘疾用戶也能成功的使用,或者是在輔助應(yīng)用程序或設(shè)備的幫助下成功的使用?;?iPhone 操作系統(tǒng)的設(shè)備包含許多方便用戶(包括殘疾用戶)的特性,,例如可視化語音郵件,放大,以及語音控制。并且,你無需在你的應(yīng)用程序中介入任何東西,即可確保用戶從這些特性中受益。,iPhone開發(fā)教程之使你的程序具有無障礙性,With VoiceOver, the story is a little diffe
29、rent. VoiceOver is Apple’s innovative screen-reading technology, which gives users control over their devices without requiring them to see the screen. To make sure VoiceOver users can use your application to its fullest
30、, you might need to provide some custom information about the views and controls in the user interface. 說道VoiceOver,這個故事略有不同。VoiceOver是蘋果的創(chuàng)新屏幕閱讀技術(shù),利用這種技術(shù),用戶無需看到屏幕,就可以控制自己的設(shè)備。為了確保VoiceOver用戶可以盡情地使用你的應(yīng)用程序,你可能需要提供一些關(guān)于用戶界面中
31、視圖和控件的自定義信息。,iPhone開發(fā)教程,Fortunately, UIKit controls and views are accessible by default, so when you use standard elements in a completely standard way, you have little (if any) additional work to do. The more custom you
32、r user interface is, the more custom information you need to provide, so that VoiceOver can properly describe your application to users with visual impairments. 幸運的是,UIKit控件和視圖在默認就具有無障礙性,所以當(dāng)你以一個完全標(biāo)準(zhǔn)的方法應(yīng)用標(biāo)準(zhǔn)元素時,你基本只有一點兒(如
33、果有的話)額外的工作要做。你的用戶界面自定義程度越高,需提供的自定義信息就越多,這樣VoiceOver才能向那些有視覺缺陷的用戶正確地描述你的應(yīng)用程序。,iPhone開發(fā)教程,Important: The job of making your application accessible consists of giving VoiceOver the information it needs to help people u
34、se your application. The job does not include changing the visual design of the user interface to accommodate VoiceOver. 重要提示:使你的應(yīng)用程序具有無障礙性的工作包括向VoiceOver提供所需的信息,以幫助人們使用它。這種工作不包括改變用戶界面的視覺設(shè)計以適應(yīng)VoiceOver。,iPhone開發(fā)教程之重要提示,
35、Making your iPhone application accessible to VoiceOver users is the right thing to do. It can also increase your user base and it might help you address accessibility guidelines created by various governing bodies. 使Voi
36、ceOver的用戶能無障礙地訪問你的iPhone應(yīng)用程序是一件正確的事情。它也可以增加你的用戶群,幫助您落實由各種監(jiān)管組織的輔助功能規(guī)范。,iPhone開發(fā)教程,UIKit provides the search bar control you can use to display a consistent interface to initiate searching, but you are responsible for impl
37、ementing search in your application. (To learn more about the search bar, see “Search Bars”; to learn more about handling search results in code, see UISearchDisplayController Class Reference.) To ensure that search is a
38、 useful and convenient experience users appreciate, take some time to consider how to implement the process and how to display the results. 在你開始搜索時,UIKit提供了一致性界面的搜索欄控件,但在你的應(yīng)用程序中,實現(xiàn)搜索功能則是屬于你自己的責(zé)任。(要了解更多關(guān)于搜索欄的信息,請參閱“搜索欄”,
39、要了解更多關(guān)于如何在代碼中對待搜索結(jié)果的信息,請參閱 UISearchDisplayController Class 參考。)為了確保讓搜索對于用戶來說是一個有用且方便的體驗,你應(yīng)花點時間考慮如何落實搜索進程和如何顯示搜索結(jié)果。,iPhone開發(fā)教程之提供搜索功能并顯示搜索結(jié)果,In general, you should:一般來說,你應(yīng)該: Build indexes of your data so you are always
40、prepared for search. 為你的數(shù)據(jù)建立索引,以便隨時查找。 Live-filter local data so you can display results as soon as users begin to type, and narrow the results as users continue typing. 對本地數(shù)據(jù)進行即時及時篩選,一旦用戶開始輸入,你就可以顯示結(jié)果,隨著用戶繼續(xù)輸入而逐步縮小范圍
41、。,iPhone開發(fā)教程,When possible, also filter remote data as users type, but be sure to get the user’s permission if the response time is likely to delay the results by more than a second or two. 如果可能,同時篩選用戶的遠端數(shù)據(jù),如果響應(yīng)時間被推遲多于一
42、兩秒鐘,就需要用戶的許可(是否篩選遠端數(shù)據(jù))。 Display a search bar above a list or the index in a list. 在列表上面顯示搜索欄或在列表里顯示索引。 Avoid using a tab for search unless it is a primary function in your application that should be featured as a dist
43、inct mode. 避免使用標(biāo)簽作為搜索,除非它是應(yīng)用程序中的主要功能必須用一個有區(qū)別的方式顯示。,iPhone開發(fā)教程,Although live-filtering data usually produces a superior user experience, it’s not always practical. When this is the case, you can begin the search process
44、after the user taps the Search button in the keyboard. If you do this, be sure to provide feedback on the search’s progress so users know that the process has not stalled. One way to do this is to display textual results
45、 as soon as possible and display placeholder content for data that might take longer to retrieve. 雖然及時的數(shù)據(jù)篩選通常會帶來出色的用戶體驗,但這并不總是具有實用性。如果是這種情況下(非即時篩選數(shù)據(jù)),當(dāng)用戶敲擊了鍵盤上的搜索按鈕后,你才能開始執(zhí)行搜索進程了。如果你這樣做,一定要提供搜索進程情況的反饋,以便用戶知道該進程并沒有停滯不前。一
46、種方法是,盡快的先顯示文本搜索結(jié)果,而對于需要花點時間才能從數(shù)據(jù)中檢索完畢的內(nèi)容,先顯示一個占位符(后再慢慢顯示具體檢索內(nèi)容)。,iPhone開發(fā)教程,In YouTube, for example, users initiate a search for videos by tapping the Search button. If the network connection is slow, YouTube first displ
47、ays the Loading... message along with a spinning activity indicator so users know that search is proceeding. Then, YouTube displays a results list in which each row is populated with textual results, such as video title
48、and viewer rating, and a custom image of a box with a dotted outline. As users scan the list of video titles, the video thumbnails replace the dotted boxes as they are downloaded. Displaying partial search results while
49、additional data is still downloading gives users useful information promptly. 在YouTube,例如,用戶點擊搜索按鈕開始視頻搜索。如果網(wǎng)絡(luò)連接速度慢,YouTube上首先顯示 正在載入... 的信息和一個旋轉(zhuǎn)指示符,以便用戶知道搜索在進行中。然后,YouTube以列表的形式的顯示出結(jié)果,以文本的形式填充每一行,例如視頻標(biāo)題和評分,以及一個點線描邊自定義圖像
50、框。當(dāng)用戶在瀏覽視頻標(biāo)題列表時,視頻的縮略圖也在同時下載,當(dāng)下載完完成后,他們會機會替換掉點線框。當(dāng)更多數(shù)據(jù)在被下載的時候,先顯示局部搜索結(jié)果,能夠盡快地給用戶提供有用的信息。,iPhone開發(fā)教程,If you handle data that sorts naturally into different categories, you can provide a scope bar. A scope bar contains up
51、to four scope buttons, each representing a category. For example, Mail provides a scope bar that allows users to focus their search on the From, To, or Subject fields of messages, or broaden the search to include all fie
52、lds. Consider providing a scope bar if it helps users focus their search or if it significantly reduces the number of results. (To learn how to implement a scope bar in your code, see UISearchBar Class Reference.) 如果你要處
53、理本來就屬于不同種類的數(shù)據(jù),你可以提供一個范圍欄。一個范圍欄包含四個范圍選擇按鈕,分別代表一個類別。例如,郵件提供了一個范圍控件欄,讓使用者可將其搜索集中在,發(fā)件人,收件人或郵件的主題,或把搜索擴大到全部。如果它能夠幫助用戶讓搜索更集中,或者是能顯著地減少搜索結(jié)果數(shù),那么就應(yīng)該提供范圍欄。 (要了解如何在你的代碼里實現(xiàn)一個范圍欄,參見 UISearchBar Class 參考。),iPhone開發(fā)教程,Users appreciate
54、application features that allow them to automatically tag content with their physical location, or to find friends that are currently nearby. Users also appreciate being able to disable features like these when they don’
55、t want to share their location with others. Users can grant (or deny) system-wide access to their physical location with the Location Services setting in Settings > General. 用戶喜歡應(yīng)用程序提供的允許用戶使用物理位置來自動標(biāo)記內(nèi)容,尋找當(dāng)前附近的朋友的特色功
56、能。當(dāng)用戶不想與他人分享位置信息時,他們也希望能有禁用的功能。用戶可以在“設(shè)置”應(yīng)用程序中的常規(guī)菜單中,全系統(tǒng)地設(shè)置允許或者拒絕通過位置服務(wù)獲取他們的物理位置。,iPhone開發(fā)教程之利用用戶的位置,If users turn off Location Services, and later use an application feature that requires their location, they see an aler
57、t that tells them they must change their preference before they can use the feature. The alert does not allow them to make this change within the application; instead, they must go to Settings and change their preference
58、. This ensures that users are fully aware that they are granting system-wide permission to use their location information. 如果用戶關(guān)閉位置服務(wù),隨后使用應(yīng)用程序某個需要提供位置的功能,他們將會看到一個提醒,告訴他們必須修改預(yù)設(shè),才可以使用該功能。提醒不提供給用戶在當(dāng)前應(yīng)用程序修改預(yù)設(shè)的功能,反而,他們必須進入“設(shè)
59、置”應(yīng)用程序,然后改變他們的預(yù)設(shè)。這可確保用戶充分認識到,他們在全系統(tǒng)地允許系統(tǒng)使用他們的位置信息。,iPhone開發(fā)教程,To help users understand why they might need to turn Location Services on, it’s best if they see the alert only when they attempt to use a feature that clearl
60、y needs to know their current location. For example, people can use Maps when Location Services is off, but they see the alert when they access the feature that finds and tracks their current location. 為了幫助用戶了解為什么他們需要打開
61、位置服務(wù),最好的方式是,在他們打開某個需要知道他們當(dāng)前位置的功能的時候,給他們一個提醒。例如,當(dāng)位置服務(wù)是關(guān)閉時,人們依然還是可以使用地圖服務(wù)的,但他們想獲取或者是跟蹤他們當(dāng)前的位置的時候,他們將會看到一個提醒。,iPhone開發(fā)教程,If Location Services is turned off, iPhone OS displays the alert the first time your application tries
62、 to access location information. The Core Location framework provides a way for you to get the user’s preference so that you can avoid triggering this alert unnecessarily or inappropriately. (See Core Location Framework
63、Reference to learn more about this programming interface.) 如果位置服務(wù)是關(guān)閉的,當(dāng)你的應(yīng)用程序第一次嘗試訪問位置信息時,iPhone 操作系統(tǒng)將顯示提醒。核心位置(Core Location)框架提供了一種方法讓你可以獲得用戶對位置服務(wù)的預(yù)設(shè),避免你不必要的或不適當(dāng)?shù)挠|發(fā)此提醒。(要了解更多此編程接口信息,參見Core Location Framework Reference
64、。),iPhone開發(fā)教程,With knowledge of the user’s preference, you can trigger the alert as closely as possible to the feature that requires location information, or perhaps avoid it altogether. 獲取了用戶對位置服務(wù)的預(yù)設(shè)以后,你就可以只為那些非常緊密地非???/p>
65、能需要用戶位置信息的功能,觸發(fā)提醒,或者說,完全地避免這些提醒。 If your application cannot perform its primary function without this information, it’s best if users see the alert as soon as they start your application. Users will not be bothered by t
66、his, because they understand that the main function of your application depends on knowing their location. 如果你的應(yīng)用程序主功能沒法在沒有位置信息的環(huán)境下工作,最好就是讓用戶在啟動它時就看到提醒。用戶不會因此而感覺不快,因為他們明白,你的應(yīng)用程序的主功能的執(zhí)行依賴于他們自己的位置信息。,iPhone開發(fā)教程,If the use
67、r’s location is not part of the essential function of your application, you might choose to simply restrict the feature that uses it. For example, when Location Services is turned off, Camera automatically turns off the
68、feature that adds the user’s location to the photos they take. It does not prevent users from taking photos unless they change their preference, because adding location information to photos is appreciated, but not essen
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- tkinter教程之button篇(2)
- android教程之開發(fā)移動 web ajax 應(yīng)用
- et教程系列-文字教程之
- 2入門教程之調(diào)色金黃變綠效果
- iphone新手必看教程初學(xué)入門教程
- flash教程之骨骼動畫
- 創(chuàng)業(yè)實戰(zhàn)教程之(二)
- android教程之認識android系統(tǒng)
- 大量傷患之處理
- painter教程之寫實人物繪畫
- maya教程之建??ㄍɑ疖?/a>
- 蘋果iphone4拆機圖解教程
- 笙教程之比較研究
- iphone4跳過激活教程
- iphone怎么屏蔽短信廣告 iphone七大功能關(guān)閉教程
- photoshop教程之摳圖【新手必看】
- iphone開發(fā)入門(1)程序員眼中的iphone
- iphone必用installer軟件詳細使用教程
- iphone5詳細拆機圖文教程
- [globalmapper系列教程之七]挖填方計算
評論
0/150
提交評論