您好,欢迎访问三七文档
1、苹果官方API翻译1.UIImageViewAUIImageViewobjectdisplaysasingleimageorasequenceofanimatedimagesinyourinterface.ImageviewsletyouefficientlydrawanyimagethatcanbespecifiedusingaUIImageobject.Forexample,youcanusethisclasstodisplaythecontentsofmanystandardimagefiles,suchasJPEGandPNGfiles.Youcanconfigureimageviewsprogrammaticallyorinyourstoryboardfileandchangetheimagestheydisplayatruntime.Foranimatedimages,youcanalsousethemethodsofthisclasstostartandstoptheanimationandspecifyotheranimationparameters.2.UIImag。
2、eAUIImageobjectmanagesimagedatainyourapp.Youuseimageobjectstorepresentimagedataofallkinds,andtheUIImageclassiscapableofmanagingdataforallimageformatssupportedbytheunderlyingplatform.Imageobjectsareimmutable,soyoualwayscreatethemfromexistingimagedata,suchasanimagefileondiskorprogrammaticallycreatedimagedata.Animageobjectmaycontainasingleimageorasequenceofimagesyouintendtouseinananimation.3.NSTimerYouusetheNSTimerclasstocreatetimerobjectsor,moresimply,timers.Atimerwaitsuntilacertaintimeintervalhas。
3、elapsedandthenfires,sendingaspecifiedmessagetoatargetobject.Forexample,youcouldcreateanNSTimerobjectthatsendsamessagetoawindow,tellingittoupdateitselfafteracertaintimeinterval.Timersworkinconjunctionwithrunloops.Touseatimereffectively,youshouldbeawareofhowrunloopsoperate—seeNSRunLoopandThreadingProgrammingGuide.Noteinparticularthatrunloopsmaintainstrongreferencestotheirtimers,soyoudon’thavetomaintainyourownstrongreferencetoatimerafteryouhaveaddedittoarunloop.Atimerisnotareal-timemechanism;itfire。
4、sonlywhenoneoftherunloopmodestowhichthetimerhasbeenaddedisrunningandabletocheckifthetimer’sfiringtimehaspassed.Becauseofthevariousinputsourcesatypicalrunloopmanages,theeffectiveresolutionofthetimeintervalforatimerislimitedtoontheorderof50-100milliseconds.Ifatimer’sfiringtimeoccursduringalongcalloutorwhiletherunloopisinamodethatisnotmonitoringthetimer,thetimerdoesnotfireuntilthenexttimetherunloopchecksthetimer.Therefore,theactualtimeatwhichthetimerfirespotentiallycanbeasignificantperiodoftimeafte。
5、rthescheduledfiringtime.SeealsoTimerTolerance.4.UIScrollViewUIScrollViewisthesuperclassofseveralUIKitclassesincludingUITableViewandUITextView.ThecentralnotionofaUIScrollViewobject(or,simply,ascrollview)isthatitisaviewwhoseoriginisadjustableoverthecontentview.Itclipsthecontenttoitsframe,whichgenerally(butnotnecessarily)coincideswiththatoftheapplication’smainwindow.Ascrollviewtracksthemovementsoffingersandadjuststheoriginaccordingly.Theviewthatisshowingitscontent“through”thescrollviewdrawsthatport。
6、ionofitselfbasedontheneworigin,whichispinnedtoanoffsetinthecontentview.Thescrollviewitselfdoesnodrawingexceptfordisplayingverticalandhorizontalscrollindicators.Thescrollviewmustknowthesizeofthecontentviewsoitknowswhentostopscrolling;bydefault,it“bounces”backwhenscrollingexceedstheboundsofthecontent.Theobjectthatmanagesthedrawingofcontentdisplayedinascrollviewshouldtilethecontent’ssubviewssothatnoviewexceedsthesizeofthescreen.Asusersscrollinthescrollview,thisobjectshouldaddandremovesubviewsasnece。
7、ssary.Becauseascrollviewhasnoscrollbars,itmustknowwhetheratouchsignalsanintenttoscrollversusanintenttotrackasubviewinthecontent.Tomakethisdetermination,ittemporarilyinterceptsatouch-downeventbystartingatimerand,beforethetimerfires,seeingifthetouchingfingermakesanymovement.Ifthetimerfireswithoutasignificantchangeinposition,thescrollviewsendstrackingeventstothetouchedsubviewofthecontentview.Iftheuserthendragstheirfingerfarenoughbeforethetimerelapses,thescrollviewcancelsanytrackinginthesubviewandpe。
8、rformsthescrollingitself.SubclassescanoverridethetouchesShouldBegin:withEvent:inContentView:,pagingEnabled,andtouchesShouldCancelInContentView:methods(whicharecalledbythescrollview)toaffecthowthescrollviewhandlesscrollinggestures.Ascrollviewalsohandleszoomingandpanningofcontent.Astheusermakesapinch-inorpinch-outgesture,thescrollviewadjuststheoffsetandthescaleofthecontent.Whenthegestureends,theobjectmanagingthecontentviewshouldshouldupdatesubviewsofthecontentasnecessary.(Notethatthegesturecanenda。
9、ndafingercouldstillbedown.)Whilethegestureisinprogress,thescrollviewdoesnotsendanytrackingcallstothesubview.TheUIScrollViewclasscanhaveadelegatethatmustadopttheUIScrollViewDelegateprotocol.Forzoomingandpanningtowork,thedelegatemustimplementbothviewForZoomingInScrollView:andscrollViewDidEndZooming:withView:atScale:;inaddition,themaximum(maximumZoomScale)andminimum(minimumZoomScale)zoomscalemustbedifferent.5.UIPageControlThisapplicationprimarilydemonstratesuseofUIScrollView'spagingfunctionalitytou。
10、sehorizontalscrollingasamechanismfornavigatingbetweendifferentpagesofcontent.WiththeiPad,thistypeofuserinterfaceisnotreallynecessarysincethescreenislargerallowingformorecontentanddetailedinformation.DesignedasauniversalapplicationforbothiPhoneandiPad,thissampleshowshowtousetwodifferentsetsofcontent,dependingonwhichdevicethesampleisrunning.TheideaisthattheiPhoneusesasmallersetofimages,whiletheiPadusesalargersetofimagesplusmoredetailedinformation.Asauniversalappthissampleshowshowtofactoroutthesetwo。
本文标题:文献翻译英文
链接地址:https://www.777doc.com/doc-8693668 .html