文献翻译英文.docx
《文献翻译英文.docx》由会员分享,可在线阅读,更多相关《文献翻译英文.docx(7页珍藏版)》请在冰豆网上搜索。
文献翻译英文
苹果官方API翻译
1.UIImageView
AUIImageViewobjectdisplaysasingleimageorasequenceofanimatedimagesinyourinterface.ImageviewsletyouefficientlydrawanyimagethatcanbespecifiedusingaUIImageobject.Forexample,youcanusethisclasstodisplaythecontentsofmanystandardimagefiles,suchasJPEGandPNGfiles.Youcanconfigureimageviewsprogrammaticallyorinyourstoryboardfileandchangetheimagestheydisplayatruntime.Foranimatedimages,youcanalsousethemethodsofthisclasstostartandstoptheanimationandspecifyotheranimationparameters.
2.UIImage
AUIImageobjectmanagesimagedatainyourapp.Youuseimageobjectstorepresentimagedataofallkinds,andtheUIImageclassiscapableofmanagingdataforallimageformatssupportedbytheunderlyingplatform.Imageobjectsareimmutable,soyoualwayscreatethemfromexistingimagedata,suchasanimagefileondiskorprogrammaticallycreatedimagedata.Animageobjectmaycontainasingleimageorasequenceofimagesyouintendtouseinananimation.
3.NSTimer
YouusetheNSTimerclasstocreatetimerobjectsor,moresimply,timers.Atimerwaitsuntilacertaintimeintervalhaselapsedandthenfires,sendingaspecifiedmessagetoatargetobject.Forexample,youcouldcreateanNSTimerobjectthatsendsamessagetoawindow,tellingittoupdateitselfafteracertaintimeinterval.
Timersworkinconjunctionwithrunloops.Touseatimereffectively,youshouldbeawareofhowrunloopsoperate—seeNSRunLoopandThreadingProgrammingGuide.Noteinparticularthatrunloopsmaintainstrongreferencestotheirtimers,soyoudon’thavetomaintainyourownstrongreferencetoatimerafteryouhaveaddedittoarunloop.
Atimerisnotareal-timemechanism;itfiresonlywhenoneoftherunloopmodestowhichthetimerhasbeenaddedisrunningandabletocheckifthetimer’sfiringtimehaspassed.Becauseofthevariousinputsourcesatypicalrunloopmanages,theeffectiveresolutionofthetimeintervalforatimerislimitedtoontheorderof50-100milliseconds.Ifatimer’sfiringtimeoccursduringalongcalloutorwhiletherunloopisinamodethatisnotmonitoringthetimer,thetimerdoesnotfireuntilthenexttimetherunloopchecksthetimer.Therefore,theactualtimeatwhichthetimerfirespotentiallycanbeasignificantperiodoftimeafterthescheduledfiringtime.SeealsoTimerTolerance.
4.UIScrollView
UIScrollViewisthesuperclassofseveralUIKitclassesincludingUITableViewandUITextView.
ThecentralnotionofaUIScrollViewobject(or,simply,ascrollview)isthatitisaviewwhoseoriginisadjustableoverthecontentview.Itclipsthecontenttoitsframe,whichgenerally(butnotnecessarily)coincideswiththatoftheapplication’smainwindow.Ascrollviewtracksthemovementsoffingersandadjuststheoriginaccordingly.Theviewthatisshowingitscontent“through”thescrollviewdrawsthatportionofitselfbasedontheneworigin,whichispinnedtoanoffsetinthecontentview.Thescrollviewitselfdoesnodrawingexceptfordisplayingverticalandhorizontalscrollindicators.Thescrollviewmustknowthesizeofthecontentviewsoitknowswhentostopscrolling;bydefault,it“bounces”backwhenscrollingexceedstheboundsofthecontent.
Theobjectthatmanagesthedrawingofcontentdisplayedinascrollviewshouldtilethecontent’ssubviewssothatnoviewexceedsthesizeofthescreen.Asusersscrollinthescrollview,thisobjectshouldaddandremovesubviewsasnecessary.
Becauseascrollviewhasnoscrollbars,itmustknowwhetheratouchsignalsanintenttoscrollversusanintenttotrackasubviewinthecontent.Tomakethisdetermination,ittemporarilyinterceptsatouch-downeventbystartingatimerand,beforethetimerfires,seeingifthetouchingfingermakesanymovement.Ifthetimerfireswithoutasignificantchangeinposition,thescrollviewsendstrackingeventstothetouchedsubviewofthecontentview.Iftheuserthendragstheirfingerfarenoughbeforethetimerelapses,thescrollviewcancelsanytrackinginthesubviewandperformsthescrollingitself.SubclassescanoverridethetouchesShouldBegin:
withEvent:
inContentView:
pagingEnabled,andtouchesShouldCancelInContentView:
methods(whicharecalledbythescrollview)toaffecthowthescrollviewhandlesscrollinggestures.
Ascrollviewalsohandleszoomingandpanningofcontent.Astheusermakesapinch-inorpinch-outgesture,thescrollviewadjuststheoffsetandthescaleofthecontent.Whenthegestureends,theobjectmanagingthecontentviewshouldshouldupdatesubviewsofthecontentasnecessary.(Notethatthegesturecanendandafingercouldstillbedown.)Whilethegestureisinprogress,thescrollviewdoesnotsendanytrackingcallstothesubview.
TheUIScrollViewclass