ios - Creating multiple views programmatically -
hello ask how create multiple views programmatically , show them on screen, have tried there missing.
int x,y; x= 0; y=50; (int i=0; i<4; i++) { uiview *view = [[uiview alloc] initwithframe:cgrectmake(x, y, 300, 100)]; view.backgroundcolor = [uicolor redcolor]; [self.view addsubview: view]; y+=40; }
int x,y; x= 0; y=50; (int i=0; i<4; i++) { uiview *view = [[uiview alloc] initwithframe:cgrectmake(x, y, 300, 100)]; view.backgroundcolor = [uicolor redcolor]; view.layer.cornerradius = 5.0f; [self.view addsubview: view]; y+=140; //y next view should height of previous view , margin between view }
Comments
Post a Comment