iOS Learning essay Four

Source: Internet
Author: User

Page-base application: As an ebook application template 1 about the data source, first look at a datasource source for the Viewdidload method of Rootviewcontroller-- The initial method of the Modelcontroller2modelcontroller method provides the source and content of the data Master-detail application: Providing a template as a Notepad app here are the various ways to add the item Match parent Container: The parent container is said to be the container of the view, by setting the top and bottom margins so that it adapts to the various screen sizes split the parent container through the editor-> pin setting up and down margins: requirements: The segmented container adapts to the screen rotation-- By setting the margin line between the different sub-containers the spacing between the parent containers is passed by different horizontal spacing to a certain percentage, remember to set the parent container and the view margin, the first viewcontroller is equivalent to all the view that is built on it the parent container of the custom circular progress indicator--- This example illustrates
Import Uikitclass Progresscustom:uiview {override init (Frame:cgrect) {super.init (frame:frame) self.backg Roundcolor = Uicolor (White:1, alpha:0)} required init (coder Adecoder:nscoder) {fatalerror ("init (coder:) Have not been implemented ")} private var _progressvalue:cgfloat = 0 internal func getprogressvlue ()-& Gt    cgfloat{return _progressvalue;        } internal func Setprogressvalue (value:cgfloat) {_progressvalue = value;    Setneedsdisplay ();    }//Only override Drawrect:if perform custom drawing. An empty implementation adversely affects performance during animation. You need to override this method when the sub-diagram needs to be represented on the view override Func Drawr        ECT (rect:cgrect) {//Drawing code var CTX = Uigraphicsgetcurrentcontext (); var r = Rect.width/2 Cgcontextaddarc (ctx,r, R, R, 0, 3.1415926*2, 0) cgcontextaddlinetopoint (CTX, R,    R) Cgcontextsetrgbfillcolor (CTX, 0.7, 0.7, 0.7, 1)    Cgcontextfillpath (CTX) Cgcontextaddarc (Ctx,r, R, R, 0, 3.1415926*2*_progressvalue, 0) Cgcontextaddlineto Point (CTX, R, R) Cgcontextsetrgbfillcolor (CTX, 0, 0, 1, 1) cgcontextfillpath (CTX) Cgcontextstrokepath        (CTX) Cgcontextsetlinewidth (CTX, 5)}
Real-time preview of custom control effects: You can add properties of your own settings to the control 1: This property is accessed in the Properties window, you need to add Target-cocoa touch FRAMEWORK2 to the framework and add a keyword to the class before the IBDesignable3 each attribute that needs to be added needs to add a keyword @ibinspectable4 the property has a didset ... Layer is the original property with the main body on the 5 storyboard on the control plus the above class, then you can view the iOS view switch on this property Inspector: Switch between pictures----static method Uiview.transitionfromview ( Cyndi1, Toview:cyndi2, Duration:1, Options:UIViewAnimationOptions.TransitionFlipFromLeft, Completion:nil) Through the above method to switch from Cyndi1 to Cyndi2, option is the switch mode, completion is the function of the switching process execution, can be nil of course, by setting a bool value can be directly back and forth between the two pictures iOS view animation effect 1 set animation effect Uiview.beginanimations (nil, context:nil)//must//settings property uiview.seanimationtransition ( Uiviewanimationtransition.curldown.,...) Uiview.setanimationduration (1.0) 2 finally make sure to submit uiview.commitanimations () iOS Custom Animation Uiview.transitionwithview () to set

iOS Learning essay Four

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.