Close the love paper tail-----iOS Learning Super guessing chart

Source: Internet
Author: User

Super Guess Chart

1> Key Interface Variable element

    • The index, description, and picture will automatically change the corresponding content as you click on the Next button
    • Click the Zoom button or the image itself to enlarge the image, and when the image is enlarged, there is a layer of translucent cover at the back of the picture, cover the screen of other content click Cover or its picture can restore the image size, and the cover disappears.
    • Each time you click the Next button, the answer text option is changed.
    • Click the candidate Answer button below, which is Incognito and appears in order in the answer box above.
    • Automatically determine whether the answer is filled, the detection is correct after filling, the correct display of blue, and automatically jump to the next question at the same time, error display red.
    • Click the prompt button to display the first text of the correct answer, and deduct points.

2> some new knowledge points

1.KVC Key-value pair encoding

1-(Instancetype) Initwithdict: (Nsdictionary *) dict{2     //* * Assign a value to the model * *3     if(self =[Super Init]) {4 [self setvaluesforkeyswithdictionary:dict];5     }6     returnSelf ;7 }8 where the Setvaluesforkeyswithdictionary: method can be batch to assign the elements in the dictionary to the corresponding name of the self member variable, there are several key-value pairs in the dictionary, you can have several member variables with the same key, The dictionary key value name must be the same as the model member name and can be copied automatically. The key-value pairs in the dictionary are not all displayed. 9 Ten  One  A //KVC can also find the path -  -Nsarray *array =[Persons Valueforkeypath: @ "name"] the  -KVC when a path is taken, if the object does not contain the specified object, it automatically goes inside the object, looking for object properties.

2. Lazy Loading Fixed mode

1-(Nsarray *) Questions2 {3     if(_questions = =Nil) {4         //1. Load plist5Nsarray *temparray = [Nsarray arraywithcontentsoffile:[[nsbundle mainbundle] Pathforresource:@"Questions"OfType:@"plist"]];6        7         //2. Creating a Model array8Nsmutablearray *arraym =[Nsmutablearray array];9          for(Nsdictionary *dictinchTemparray) {Ten [Arraym addobject:[hzhquestions questionwithdict:dict]; One         } A_questions =Arraym; -     } -     return_questions; the } -  -The plist file is first judged empty, the model array is created with a for loop, and the model array is saved to the member variable array.

3. Set the status bar display

1 //Setting the status bar highlighting2-(uistatusbarstyle) preferredstatusbarstyle{3     returnuistatusbarstylelightcontent;4 }5 //Set status bar general display6-(uistatusbarstyle) preferredstatusbarstyle{7     returnUistatusbarstyledefault;8 }9 //Setting status bar visibilityTen-(BOOL) prefersstatusbarhidden{ One  A     returnYES; -} 

The status bar defaults to show black

Highlight Status Display White

4. Move the picture object to the front of the Masked object

1 [Self.view BringSubviewToFront:self.pictureView]

5. Set the control to hidden

1 option.hidden = YES;

6. Remove the title of the control

1  NSString *temp = [btn Titleforstate:uicontrolstatenormal];

7. Splash screen and app icon

As long as the file name is "Icon.png", it will be set to the app icon.

a The app will display a full screen called def during the boot process. pictures of Ault.png.

Use cases without the specification default

  1. Default.png: Non-retina-iphone screen, 320x480
  2. [Email protected]:retina-iphone screen, 640x960
  3. [Email protected]:4inch retina-iphone screen, 640x1136
  4. Default-portrait~ipad.png: Non-retain-ipad vertical screen, 768x1024
  5. [Email protected]:retain-ipad vertical screen, 1536x2048
  6. Default-landscape~ipad.png: Non-retain-ipad horizontal screen, 1024x768
  7. [Email protected]:retain-ipad horizontal screen, 2048x1536

8. Set the inner margin manufacturing photo frame effect

Use a white picture as the background image, and then set the margin insert for the picture. You get the effect as shown on the right.

9. Animations at Large images

Creates a button with a background color of black, setting its transparency alpha.

Block instead of the tail-up animation, high efficiency.

1[UIView animatewithduration:2.0animations:^{2        //storing animations that need to be performed3Cover.alpha =0.6;4          5CGFloat HEADW =Self.view.frame.size.width;6CGFloat headh =Headw;7CGFloat HEADX =0;8CGFloat heady =0.5* (self.view.frame.size.height-headh);9Self.head.frame =CGRectMake (HEADX, Heady, HEADW, headh);Ten           One}];

10. Click the Options button

(1) The clicked option button disappears (hidden = YES) (2) Place the text of the selected option on the button in the answer area (3) Put the text on the first answer button without text (4) Click the Answer button with text, and the text reverts to the option (5) When the answer is filled, block the event from triggering

♥ above are some of the main new things I think about in this small case, make a little note ♥

Close the love paper tail-----iOS Learning Super guessing chart

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.