Xcode 7A152u incorrectly encodes image asset configured to be tiled with zero insets
| Originator: | argentumko | ||
| Number: | rdar://21887772 | Date Originated: | 19-Jul-2015 |
| Status: | Closed | Resolved: | Yes |
| Product: | Developer Tools | Product Version: | Xcode 7A152u |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
An image asset configured in Asset Catalog to be "sliced" horizontally and vertically, with tiled center as large as the image itself, is being encoded as a non-resizable image. As a result, in an iOS app a large image view will stretch that image, not tile it. This happens when running the built app on either iOS 9 or iOS 8 – though notice that image is displayed correctly tiled when used in Interface Builder.
When building the same app in Xcode 6E35b (6.4 GM), image is displayed correctly when running on iOS 8, however when running on iOS 9, it becomes stretched in a completely different, unexpected way.
Steps to Reproduce:
1. Create a new project with a single view controller.
2. Put a small square image into the asset catalog – with @1, @2 and @3 versions.
3. Configure each resolution version of that image like this:
– Slices: Horizontally and Vertically;
– Caps: 0, 0, 0, 0;
– Center: Tiles
– Width: (image width), Height: (image height).
4. Put an image view into the storyboard scene. Configure it with the newly added image. Notice how Interface Builder correctly tiles the image.
5. Run the app on either iOS 8 or iOS 9.
Expected Results:
The image is expected to be tiled across the image view.
Actual Results:
Image is stretched.
Version:
Xcode 7A152u, running OS X 10.10.4 (14E46)
Notes:
A workaround is to explicitly configure the image to be resizable with zero insets and tiled resizing mode.
I should note again that when building this using Xcode 6.4 and running iOS 9, the situation becomes even worse and the workaround doesn't even help!
Configuration:
Occurs if building with Xcode 7A152u, but not if building with Xcode 6.4 and earlier. Doesn't occur if the image uses a non-zero resizing insets.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Vlas Voloshin
As of Xcode 7A176x (beta 5), this issue is now fixed. This issue has been verified as resolved and can be closed.