简体   繁体   中英

Pixelated UIButton edges

I'm using Storyboard and I created a UIButton with a custom image.

I have a problem that the edges of the button are pixelated:

Image:

图片

Any idea? Thank you!

3 Ways to create this button.

  1. You can add plus character in the default button. Give the red background and corner radius.
  2. Add all assets like @1x, @2x and @3x in the folder.

    You can prepare assets by using Prepo or a tool for Xcode RTImageAssets Or any-other tool that fits your requirement.

  3. Use vector image as asset. Article : Use of vectors in Xcode

If you are viewing this in the simulator in scaled mode, the image may appear to be blurry. Viewing this in 100%scaling mode may remove this effect. But if you are having this problem in a device, then there is a problem with your image assets. Using adobe photoshop you can create images according iOS guidelines. This link can help you https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM