The ios icon of a real machine is distorted.

Source: Internet
Author: User

The ios icon of a real machine is distorted.

Problem description: iPhone 5S, the icon pixel is 30*30, there is no problem in the simulator, when the real machine shows the icon edge will have a jagged distortion effect.

When the image pixel is reset to 60*60, the real machine displays no problem, but the icon is too large:

This method can be used to scale and adjust its size, but there will still be distortion.

CGSize size = CGSizeMake (30, 30); UIGraphicsBeginImageContext (size); [self. imageView. image drawInRect: CGRectMake (0, 0, size. width, size. height)]; self. imageView. image = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext ();

The previous demo can be scaled without loss.

// Zoom out the image self. imageView. transform = CGAffineTransformScale (self. imageView. transform, 0.5, 0.5 );

Now the problem is solved.

The first is the resolution problem. It is not a high-definition resolution at the beginning, so it must be distorted. The following is an official reference.

Icon and image size

The second problem is lossless scaling.

However, tabBar is somewhat different.

First, the resolution meets the requirements and is loaded.

It not only blocks the text but also displays too large.

In storyboard, there is only one restriction attribute.

It indicates the relative constraint based on the tabBaritem, so use it according to the constraint.

 

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.