iOS Development Basics-Fragmentation 7

Source: Internet
Author: User
Tags uikit

38: Each version of the iphone resolution and image implementation principle

[Email protected]: iphone 4s (x 420) [email protected]: IPhones 5, 5C and 5S (x 568) [email protected]: iphone 6 (375 x 667) [Email protected]: IPhone 6+ (414 x 736) [Email Protected]~ipad:ipad (1024x768 x 768)


IPhone 4S Screen size:3.5 Inches resolution:640 x 960 (half:320 x 480)

IPhone 5 Screen size:4.0 Inches resolution:640x1136 (half:320 x 568)

IPhone 5s/5c Screen size:4.0 Inches resolution:640 x 1136 (half:320 x 568)

IPhone 6 Screen size:4.7 Inches resolution:750 x 1334 (half:375 x 667)

iphone 6 Plus screen size:5.5 Inches resolution:1242 x 2208 (1/3:414 x 736) The Size of the iphone 6 Plus is @3x scaling. So, it's divided by 3.

Interface size ratio:

The principle of image size implementation:

#import <uikit/uikit.h>typedef ns_enum (Nsinteger, Thisdeviceclass) {    Thisdeviceclass_iphone,    Thisdeviceclass_iphoneretina,    thisdeviceclass_iphone5,    thisdeviceclass_iphone6,    Thisdeviceclass_ Iphone6plus,    //We can add new devices when we become aware of them    Thisdeviceclass_ipad,    Thisdeviceclass_ipa Dretina,    thisdeviceclass_unknown};thisdeviceclass currentdeviceclass (); @interface UIImage ( Devicespecificmedia) + (Instancetype) Imagefordevicewithname: (NSString *) fileName; @end

#import "Uiimage+devicespecificmedia.h" Thisdeviceclass Currentdeviceclass () {CGFloat greaterpixeldimension = ( CGFloat) fmaxf ((float) [[UIScreen Mainscreen]bounds].size.height], ((fl    OAT) [[UIScreen mainscreen]bounds].size.width)];  Switch ((Nsinteger) greaterpixeldimension) {case 480:return ([[UIScreen Mainscreen]scale] > 1.0)?            Thisdeviceclass_iphoneretina:thisdeviceclass_iphone);        Break            Case 568:return Thisdeviceclass_iphone5;        Break            Case 667:return Thisdeviceclass_iphone6;        Break            Case 736:return Thisdeviceclass_iphone6plus;        Break  Case 1024:return ([[UIScreen Mainscreen]scale] > 1.0)? thisdeviceclass_ipadretina:thisdeviceclass_ipad            );        Break            Default:return Thisdeviceclass_unknown;    Break }} @implementation UIImage (Devicespecificmedia) + (NSString *) magicsuffixfordevice{switch (Currentdeviceclass ()) {case Thisdeviceclass_iphone:ret            Urn @ "";        Break            Case Thisdeviceclass_iphoneretina:return @ "@2x";        Break            Case Thisdeviceclass_iphone5:return @ "[email protected]";        Break Case Thisdeviceclass_iphone6:return @ "[email protected]";            or some other arbitrary string:        Break            Case Thisdeviceclass_iphone6plus:return @ "[email protected]";        Break            Case Thisdeviceclass_ipad:return @ "~ipad";        Break            Case Thisdeviceclass_ipadretina:return @ "[email protected]";        Break            Case ThisDeviceClass_unknown:default:return @ "";    Break    }}+ (Instancetype) Imagefordevicewithname: (NSString *) filename{UIImage *result = nil; NSString *namewithsuffix = [FileName StringbyappendinGstring:[uiimage Magicsuffixfordevice]];    result = [UIImage imagenamed:namewithsuffix];    if (!result) {result = [UIImage imagenamed:filename]; } return result; @end


39: Several other knowledge pictures

1:nsobject Inheritance class diagram

2:sqlite3 return meaning

3: View coordinate description

4: Life cycle diagram

5:ui inheritance Diagram

6:segue list jump, about the difference between selection and accessory

The difference between the 7:IOS6 and the IOS7 boundary page

40: Why a M is identified in the Xcode project

If SVN is not installed, the default is native git management. m indicates changes to the file, and a is the newly added file. Currently is not submitted to the server state, to the source control to select Commit commits no such, the next time there are changes or additions, the mark will also appear.

41: MAC local IP map domain name operation

1. Open Finder, shortcut key: Shift+command+g go to Folder "/etc"

2. Find the Hosts file to the desktop to modify, and/etc to delete the source files, the desktop modified to drag into/etc.

Finally in the terminal: Ping Svnserver, if able to ping to 192.168.1.51, indicating that the mapping was successful

42: arm64 armv7 armv7s ARM6


Iphone? IPhone2? Iphone3g? First generation and second generation ipod Touch armv7


? IPhone5S machine support for instruction set is backwards compatible, so armv7 instruction set can be run in iphone5s, but the efficiency is not so high ~================================================ Architecture: Refers to the set of instructions you want to support. Valid architectures: Refers to the set of instructions that will be compiled. Build Active Architecture only: Compiles only the currently applicable instruction set. ================================================ is now in early 2014, in fact, 4 and 4S users are quite a lot, and iphone3 and other machines almost no, So our instruction set must be based on ARMV7. Therefore, the value of architecture is selected: ARMv7 armv7s arm64ps: The minimum support required to select Arm64 is 5.1.1:

43: Real Machine test report TCWEIBOSDK duplicate symbols for architecture armv7

This is because the two identical class libraries referenced in the project are caused by the introduction of two different instruction sets in my project;

44: The behavior of some properties of Uinavigationbar has changed

Self.navigationController.navigationBar.barTintColor = [Uicolor blackcolor]; Self.navigationController.navigationBar.tintColor = [Uicolor Whitecolor]; [Self.navigationController.navigationBar settitletextattributes:@{nsforegroundcolorattributename: [Uicolor Whitecolor]}];self.navigationcontroller.navigationbar.translucent = NO;

iOS Development Basics-Fragmentation 7

Related Article

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.