iOS Learning Day1
Uiwindow->uiviewcontrol->uiview
UIScreen
Write Project Method:
1.storyBoard
2.xib file
3. Pure Code
Apple Phone Size
/*
IPhone4 3.5 "is not a Retina screen 32-bit system 320x480
Iphone4s 3.5 inch Retina screen 32-bit system 640x960
IPHONE5/5C 4 inch Retina screen 32-bit system 640x1136
IPhone5S 4 inch Retina screen 64-bit system 640x1136
iphone6/6s 4.7 inch Retina screen 64-bit system 750x1334
IPhone6 plus/iphone6s plus Retina screen 64-bit system 1242x2208
*/
iOS app icon
Using Software Prepo
iOS life cycle
UIview
The difference between 1.bounds and frame
Frame is the reference system of the parent view
Bounds is a reference system for itself.
The value inside the struct cannot be modified directly
Can be manipulated by manipulating local variables to change
CGRect rect = self.frame;
rect.origin.x = x;
Self.frame = rect;
Window notation:
Self.window = [[UIWindow alloc] Initwithframe:[uiscreen mainscreen].bounds];
Self.window.backgroundColor = [Uicolor blackcolor];
Self.window.rootViewController = [[Viewcontroller alloc] init];
[Self.window makekeyandvisible];
Size acquisition Software: Markman
Digital Color measuring meter:
Settings for global variables
#define Screen_width [UIScreen mainscreen].bounds.size.width
#define Screen_height [UIScreen mainscreen].bounds.size.height
A lowercase k-defined identifier acts only on a single compilation unit
All letters large writing for the global
Uicolour Summary and wording
#define RGBA (r,g,b,a) [Uicolor colorwithred: (r)/255.f Green: (g)/255.F Blue: (b)/255.f Alpha: (a)];
Picture Convert color
[Uicolor colorwithpatternimage:[uiimage imagenamed:@ "haha"];
Saturation saturation brightness brightness
[Uicolor colorwithhue:0.4 saturation:1 brightness:1 alpha:1];
[Uicolor colorwithhex:0x228942];
[Uicolor colorwithhexstring:@ "#228942"];
RGBA (124, 172, 226, 1);
#228942
Interval 0 ~ 1
[Uicolor colorwithred:124/255.f green:172/255.f blue:226/255.f alpha:1];
Grayscale Color 0 ~ 1
[Uicolor colorwithwhite:1 alpha:1];
[Uicolor Graycolor];
UIView detailed
Place v at the front
[Self.view Bringsubviewtofront:v];
Place v at the end
[Self.view Sendsubviewtoback:v];
Get all child views
Nsarray * array = [Self.view subviews];
NSLog (@ "%@", array);
Get parent View
UIView * V3 = [v Superview];
NSLog (@ "%@", V3);
Find child view by Tag value view
UIView * v4 = [Self.view viewwithtag:100];
NSLog (@ "%@", V4);
iOS Learning Day1