Original: Http://www.ui.cn/detail/59734.html?utm_source=tuicool
before, I always think of 320pt and 640px, because this can 1x2x perfect fit,
Now that the idea is a little outdated,
iphone 4 iphone 4S iphone 5 iphone 5C iphone 5S are designed with 320pt, now 357pt,414pt come, everyone is holding P6 and p6+ have face.
and Android is generally according to the design of the iOS to adjust the development of
Upgrade the system 10.12beta Xcode8 a big push to the problem, even the app on the shelves has become a problem. We can only solve these problems first, then study the 3D engine.September 7, 2016, Apple released iOS 10. September 14, 2016, the new operating system iOS 10 will be officially launched.As a developer, how to fit iOS10?1.Notification (Notification)Sin
Example.png.The picture is the same as the screen, also has 1x mode, 2x mode. In the iphone 6 Plus, there is also 3x mode, the principle is the same.When iphone 4 selects the [email protected] image, it will generate a picture with a size of 40 dots and 2x mode. This time, the picture will look very clear. And there is no adaptation of the old program, [email protected] does not exist, select Example.png, generate a size of 40 x points, 1x mode of the picture, looks more blurred. But they occup
mode will prefer [email protected], if [email protected] does not exist, select Example.png.The picture is the same as the screen, also has 1x mode, 2x mode. In the iphone 6 Plus, there is also 3x mode, the principle is the same.When iphone 4 selects the [email protected] image, it will generate a picture with a size of 40 dots and 2x mode. This time, the picture will look very clear. And there is no adaptation of the old program, [email protected] does not exist, select Example.png, generate a
PrefaceSeptember 20, formally push the official version of Xcode 9 and iOS 11, the adaptation of iOS 11 is the first to adapt, many online tutorials, not repeat. The main point here is that the adaptation of the iphone x to the big God level can not be seen, I am speaking here is mainly the basic adaptation workSummaryStart diagram: 1125 * 2436StatusBar Height: 44Tabbar Height: 83
Start the applica
1. autoresizingAutoresizing was the solution to Apple's early UI layout, and IOS6 was perfectly capable of Because the iphone only has a 3.5-inch screen, and the mobile app rarely supports a horizontal screen, iOS developers don't have to fit the layout any more, and all UI controls can be laid out relative to the parent control, yes autoresizing is a layout solution relative to the parent control; Note: I
1. autoresizingAutoresizing was the solution to Apple's early UI layout, and IOS6 was perfectly capable of Because the iphone only has a 3.5-inch screen, and the mobile app rarely supports a horizontal screen, iOS developers don't have to fit the layout any more, and all UI controls can be laid out relative to the parent control, yes autoresizing is a layout solution relative to the parent control; Note: I
efficiency2. Frame Address:Https://github.com/SnapKit/Masonry3.mas_equalto and EqualtoBy defaultMas_equalto has automatic packaging function, such as automatic packaging of 20 for the @20Equalto No automatic packaging functionIf you add the following macro, then Mas_equalto and Equalto are no different#define Mas_shorthand_globalsNote: This macro must be added to the front of #import "Masonry.h"4.mas_width and WidthBy defaultWidth is a property of the Make object that is used to add a width con
IOSVersion [[[UIDevice currentDevice] systemVersion] floatValue]#define IsiOS7Later !(IOSVersion 7.0)
The system needs to be adapted with the following points:1. (StatusBar) statusbarheight height iOS7 after StatusBar is suspended above the screen so the control layout needs to be added 20 and not required before IOS72. Label text adaptive needs to be adapted3. (iOS8 adaptation) Uialertcontroller Uialertaction-ios8 instead of Uialertview4. (iOS8 adaptation) iOS8 new location judgment
In the iOS phone interface design, because of different phone types of mobile phone size is different, then in the design of the mobile phone interface to adapt to the screen, here to the landing interface design as a simple example of the implementation of the screen adaptation method: (Screen auto-fit zoom)Effect:The following is a look at the code implementation process:1, the code implemented in the age
vertical constraint to him, then the program will be error when running, the wrong content: "Unable to simultaneously satisfy Constraints ... "; Code Description:
2. So before adding a new constraint, we have to remove the corresponding constraint previously added to our component; The constraint is added to the parent view of our corresponding component and removed from the parent view of the component;
3. When setting the value of a constraint, we pass the argument to the constraint
IPhone screen fit judgment and iOS system version judgment?
1 2 3 4 5 6 7 8 9
if([[[UIDevicecurrentDevice]systemVersion]floatValue]>=7.0) { // iOS7.0及以上版本系统适配 } if([UIScreen mainScreen].bounds.size.height == 568) { // iPhone 屏幕适配}
can be written as a macro definition placed in a PCH file,?
1 2 3 4
// 判断是否为iPhone5 #define iPhone5 ([UIScreen mainScreen].b
The design content cannot be obscured by the screen fillet, the sensor area above, and the home indicator below.Screen fillet, sensor area, and home screen supportFillet, sensor area, and home page indicators for devicesIPhone X uses screen edge gestures to access the home screen, app transitions, notification hubs, and control intentions.The security zone prevents your content from overwriting the status bar, navigation bar, toolbars, and tab bars.Https://mp.weixin.qq.com/s/7kM8Qiha7np6_QWfduxD
coordinates move down 20, because the height of the entire screen is constant, so in the ios7.0 and later mode, you need to subtract the tableview height by 20 pixels, in ios6.1 and earlier mode, Set the TableView δheight to 20. If you do not set the bottom of the Δheight,tableview will have 20 pixels is not visible, you can test the demo to see.Note ***:δ, positive number indicates increase, negative number indicates minus.Fourth step: OK, Setup complete, to look at the effect on
already have a vertical constraint, and if we add a vertical constraint to it, then the program will error when it runs, and the wrong content: "unable to simultaneously satisfy Constraints... " ;???? 2. So before adding a new constraint, we have to remove the corresponding constraint that was added to our component, and the constraint is added to the parent view of our corresponding component and removed from the parent view of the component;???? ? 3. When setting the value of a constraint, we
of clues, in fact, we can use the aspect ratio equal this, based on a certain type of aircraft, such as 5s, On the 5s view, move to Iphone6 above, the size of the view to expand, in the same way, on the 4 and 4s, the size of the view is reduced, so that the view on different size of the screen, but the size is not the same, it seems to be harmonious, Because the view is the same scale as the screen size. Usage case: PCH is a global file, the header files and macros imported in the PCH file are
Recently in the modification of an old project, there are many xib files, need to fit the iphone X, but do not want to rewrite the page with code, share a small method, is a stupid way,At the bottom of the iphone x, the iphone x has a 34px operating area on the bottom, while the other models are not, as follows:1.2.3. Double-click the arrow to enter the following interface:Then, it's ready!The above navigation adaptation, at present I have not found h
Recently, you need to use a tab to make a demo.the size of the label is based on the text above to fit the size, you need to rely on the data returned by the active line. Not joinedNsarray *arr = @[@ "ignorance", @ "changeable", @ "Shi Naian", @ "Alas", @ "Simon blowing Snow", @ "Oh Da", @ "look at", @ "hole-up", @ "a beast Sniper", @ "Acacia flower", @ "big event", @ "not sincere disturb", @ "Ah hehe"] ; CGFloat w = 0;//The width of the previous b
Setneedsupdateconstraints method.Setneedsupdateconstraints can be called internally by the Uikit or called by the developer in their own code to update the view constraints. - (void) Updateconstraints {[Self. Growingbutton mas_updateconstraints:^ (Masconstraintmaker *make) {make. Center. Equalto (self); Make. width. Equalto (buttonsize. Width). Prioritylow (); make. Height. Equalto (@ ( buttonsize.height). Prioritylow (); make. Width. Lessthanorequalto (self); Make. Height. Lessthanorequalto (s
Recently the Xcode upgrade to 7, and then is a variety of egg pain problems, there is a screen adaptation of the problem, because my project is older, so, has not been much attention to screen adaptation, are iOS automatic adaptation, which before iOS8 no problem, but after iOS9, this problem appears , after starting the program, there is a black screen on the bottom, found some information, to understand:Starting with the Xcode6 GM version, the simul
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.