iOS Learning Day1

Source: Internet
Author: User

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

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.