1. Complete the following layout
2. Analysis
Look for the law on the left, each uiview x-coordinate and y-coordinate.
3. Realization of Ideas
(1) Make clear what each piece is used for. View
(2) Identify the parent-child relationship between each view, with only one parent view and a large number of child views.
(3) You can first try to add a lattice, and finally consider using a for loop, complete the creation of all UIView
(4) Load the app data, create the corresponding number of squares according to the data length
(5) Adding child controls inside the lattice
(6) Assembling data for internal child controls
4. Some new methods or properties
4.1
-(void) Click on the UILabel {//animated label *animalab=[[uilabel Alloc]initwithframe:cgrectmake ( Self.view.center.x-100, SELF.VIEW.CENTER.Y+20, 200, 40)]; [Animalab settext:@ "Download Success"]; animalab.font=[uifont systemfontofsize:12.0]; Set Font size [Animalab setbackgroundcolor:[uicolor Browncolor]]; [Animalab setalpha:0] ; Transparency 94 [Self.view Addsubview:animalab]; [ UIView Beginanimations:nil Context:nil]; 97 [Animalab setalpha:1]; 98// [UIView setanimationduration:4.0];// [UIView commitanimations];100 101 //After execution, we have to delete this, we recommend using block Animation 102 set animation 103 [UIView animatewithduration:4.0 animations:^{104 [Animalab setalpha:1];105 } completion:^ (BOOL finished) {106 //[self.view re];107 }]; 108}
iOS development UI chapter-nine grid coordinate calculation