-(BOOL) application: (uiapplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchoptions {
Override point for customization after application launch.
//load at first run time
//Run only once each time, the system automatically listens .
self. Window = [[UIWindow alloc]initwithframe: CGRectMake(0, 0, +, 568)];
Background color settings
[Self. Window setbackgroundcolor: [Uicolor Graycolor]];
//Set Home screen and display
[Self. Window makekeyandvisible];
Create UIView
UIView *aview = [[UIView alloc]initwithframe: CGRectMake(0, +,--)];
[Aview setbackgroundcolor: [Uicolor Orangecolor]];
[Self. Window addsubview: Aview];
UIView *bview = [[UIView alloc]initwithframe: CGRectMake(Ten , +, +)];
[Bview setbackgroundcolor: [Uicolor Redcolor ]];
[Aview Addsubview:bview];
UIView *cview = [[UIView alloc]initwithframe: CGRectMake( +, +, +)];
[CView setbackgroundcolor: [Uicolor Greencolor]];
[Aview Addsubview:cview];
Act 1. assigning a property to a value modification
CView. frame = CGRectMake (0, +, +);
Act 2.
[CView Setframe:cgrectmake (50, 0, 50, 50)];
[Aview release];
[Self.window release];
//Get tried by the parent trying to
Strong Turn (UIWindow)
UIWindow * Fatherview = (UIWindow *) [Aview Superview];
NSLog (@ "father =%@", fatherview);
//Get all the children the parent tries to try
returns an array
Nsarray * arr = [Aview subviews];
NSLog (@ "subs =%@", arr);
Insert a View
UIView *newview = [[UIView alloc]initwithframe: CGRectMake( +, +, +)];
[Newview setbackgroundcolor: [Uicolor Whitecolor]];
[Aview Insertsubview:newview Abovesubview:bview];
[Newview release];
//Put above B but the array position after inserting the view array position, the more
Management attempt hierarchy
put the Newview on top of the attempt.
[Aview Bringsubviewtofront:newview];
NSLog (@ "%@", arr);
NSLog (@ "%@", [Aview subviews]);
try to put the Newview in the bottom .
[Aview Sendsubviewtoback:newview];
NSLog (@ "%@", [Aview subviews]);
//Swap two sub-index locations to try to
[Aview exchangesubviewatindex: 0 withsubviewatindex: 2];
NSLog (@ "%@", [Aview subviews]);
remove receiver from the parent map
Remove The Newview from the
[Newview Removefromsuperview];
NSLog (@ "%@", [Aview subviews]);
Set hidden Properties
Aview.hidden = YES;
[Aview Sethidden:NO];
//Set Transparency property call
Bview.alpha = 0.5;
[Bview setalpha:1];
to mark a view
Bview. tag =1;
//Center point Child View relative to parent view
Bview. Center = Cgpointmake (+);
return YES;
}
IOS Basics first Section UIview