iOS Development--full project in combat OC & Sixth day of best sister

Source: Internet
Author: User

The sixth day of Miss Scarlett's sister Morning One: Load view with XibGenerally we are directly in the category, because the Xib loading code is the sametwo: Two common properties of the keyboard
    • Inoutaccessoryview
    • Inputview
Three: Switching system and the simple use of custom keyboard, is not very pervertedDepending on the keyboard used to determine the type and switchFour: The use of animation, in fact, is set to switch the time on itV: Special needs, direct total definition and add view (do not use Inoutaccessoryview)Use the Notification Implementation toolbar to follow the keyboard's movement: (height of keyboard up) 1: Change y value, change y value up and down, use transform generally there are three common notifications, here we use frame change notification, because contains the first two kinds of notice (note,   The object here can pass nil, because no matter what is passed, the system will be empty, monitoring the keyboard changes to notify the object does not matter) we can see the keyboard change when the best way to notify the change of all properties: the height of the screen minus the final Y value of the keyboard Implement keyboard Toggle Animations: Note the time to toggle animations here
1 #pragmaMark-Monitor2- (void) Keyboardwillchangeframe: (Nsnotification *) Note3 {4CGFloat Duration =[Note.userinfo[uikeyboardanimationdurationuserinfokey] doublevalue];5    6[UIView animatewithduration:duration animations:^{7         //distance of the tool bar = = Keyboard final y value-screen height8CGFloat ty = [Note.userinfo[uikeyboardframeenduserinfokey] CGRECTVALUE].ORIGIN.Y-xmgscreenh;9Self.toolbar.transform = Cgaffinetransformmaketranslation (0, Ty);Ten     }]; One}

Six: Two common attributes about modalSeven: The placeholder Text property settings need to be done after the placeholder text is set, the previous setting has no effectThis time we can textfield add a classification, and added a property, but will be the error category to write a property, will only generate the getter and setter method declaration, will not implement only the declaration, as follows we need to implement, implement the method in the classificationEight: Sometimes, or we will first set the corresponding color, in the setting of text, but found that the direct collapse, this time we can speculate, the default who he a text attribute, here we in the Placeholdercolor setter method implementation to completeThere is no rule at this time of setting!Nine:awayfromnib method
    • Control only needs to be added once
    • Load from Xib or file (Initwithcoder)
10: When the viewdidload is called, the navigation controller is empty:Setting the corresponding properties in the navigation controller will have no effect at this time: Workaround:
    • Adjust position
    • Do not set color
Afternoon 11: Block Simple Summary and writing method12: Monitor the change of Uitextview textAgent: normal keyboard monitoring, but the function is not enough full attention: half of us are really textdidchange method to implement the change of listening text13: Sometimes when we use sizetofite, the height of the Set Font Size button will be reduced, but this is not the effect we want, so this time we will set the internal, automatic adjustment after setting a height can be achieved! 14: After the keyboard is ejected we can use the runtime to view the corresponding keyboard or view all child controls15: Click on the keyboard to remove the button implementation method: Need to enter the header file to findSo we usually call him to delete the text is very simple16: Using the Block pass value implementation1): Define the block attribute in the header file or declare a block type first
    • typedef void(^deletebackwardoperation) ();
define the block name again/** What you need to do when clicking the Delete button * /
  • @property(nonatomic, copy) deletebackwardoperation block;
2): In the implementation file according to the criteria and whether to execute Block 3): Execute block code details see: http://www.cnblogs.com/iCocos/p/4659878.html Night

iOS Development--full project in combat OC & Sixth day of best sister

Related Article

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.