iOS 5.1 with Xcode 4.3.1: [UIColor colorWithPatternImage:] strange behavior only on device - iphone

When I compile my app in Xcode 4.3.1 with iOS 5.1, I notice there is a strange behavior with background textures only on actual device. There is a 1px gap in between texture tiles shown in screenshot below.
My texture are 150x150 and 300x300 at 2x.
So far I've tested the same build on:
Simulator iPhone/iPad both 5.0/5.1: No bug
iPhone/iPad running 5.0.1: No bug
iPhone/iPad running 5.1: Buggy

I've been getting the same problem since 5.1 aswell. I solved it by doing the following to the image in photoshop. You can probably do the same in another tool.
Load the file, select all, and copy to clipboard
Create a new file in photoshop that is the same dimension, RGB and 8bit depth with 72pixels/inch resolution with a white background.
Paste the image you copied in step 1 into this image
Save the file and use this one.
After doing this the file displayed correctly on the device and I didn't have to resort to creating images the size of the display.

My workaround:
Set "Compress PNG Files" to "No" in Build Settings. In my case the size of the app bundle was even smaller than with compression turned on. I did image optimization myself.

just in case anyone else is having this problem and uses pngoptimizer, try a new png without optimizing it.
I had the same problem and spent the last 4 hours trying to solve it.
In the end i realized it was png file from the pngoptimizer tool that somehow always worked before iOS 5.1 but with the update the same png file produces this thin line at the bottom. the strange thing is that this does only happen on the device and not in simulator and that deceives you a lot because you think it cant be the graphic. in fact it is.

Related

Strange issue with non retina display in iphone

My app was working fine both in simulator and iPhone 4 when i had only "image.png" . When I added "image#2x.png" screen's UI became distorted in actual device,simulator has no issues. Device is iphone 4 non-retina.
Do I need to specify anything when #2x images are added?
Just to confirm, you're not using a prerelease of Xcode 5, are you? If so, no one here is allowed to help you, and you should march yourself over to the Apple Developer forums.
That is strange. You shouldn't need to do anything other than creating the #2x version. Double and triple check that the files look as expected, and that the 2x version is exactly double the resolution in each direction (that is: if the original is 50x50, the 2x must be 100x100).
Next, try doing Product->Clean, delete the app from the device and then run it again. Sometimes weird things are solved that way. Also, restarting Xcode can't hurt, I've had that resolve more than a few Really Weird Issues.

iPhone 5 Web Browser - transparent .png with black matte

I often use 24-bit transparent .png files in web design. I recently checked an iPhone 5, mostly to look at the viewport, and noticed my .png files all have a black matte?
Went back and checked an iPhone 4 and everything looks fine there. Not sure what to say. I've been saving files the same way since 2007! Either a save-for-web from Photoshop or a direct save-as.
Any ideas? Is mobile Safari the new IE 6?
I looked into this a little more, including testing more than one iPhone5.
It's a colour profile issue saving out of Photoshop. I opened the files and assigned a colour profile (I assigned sRGB to one and colormatch to the other) and they work fine with either.
Normally I use sRGB for all my images, so it's strange, but definitely a local issue to my files, as saved from Photoshop. It doesn't totally make sense to me that the colour profile wasn't there in the first place, but at least I understand this now.
Hope fully it helps someone.

Background image on iPhone 4 causes webapp to run slow

I'm porting one of my projects to iPhone 4.
It's a Sencha Touch application, running via PhoneGap wrapper (that means UIWebView). Everything runs rather smoothly on iPhone 3(GS) and the simulator ofc. But on iPhone 4 (we've tested on several phones) the css rule for panel background makes the whole app run very slow including scrolling and tab transitions:
background-image: url(../images/background/main_panel__background.png); /*320x317*/
That causes all the stutter and lags.
I've tried to convert the image to JPEG and replace it - still nothing helps.
What could it be? I know that WebKit rendering engine does some scaling (1x1 -> 2x2) to accomodate for high resolution of "Retina" displays, but why would it cause such slowdown?
Thank you.
I discovered the same issue with background image and i am not sure what could be the reason. Actually i suspected the Alpha of my png to cause the issue, but apparently you had it with jpg too... For now i remove the picture. We could use CSS to remove it only for iPhones...

iOS - Build Freezes When I Build To Device but Not in Simulator

I'm curious if someone can help me figure out what is going on...
I have an app that works fine in the simulator with no warnings or errors but when I try to even build with the device selected it appears to freeze. I've left it building for over 20minutes with no luck.
The application uses a large number of animated PNG sequence and a few videos but that didn't appear to be a problem until today.
Any insight would be appreciated...
What has changed in your environment since yesterday?
Can you back off the number of images to say 3 small ones, and one short video, and see if it builds then? Then add them back in a few at a time to see where it's breaking. Divide an conquer.
Turned out to be an odd problem with XCode compressing the PNGs in my project.
Turned off the PNG compression and it complied in no time.

iPhone screenshot different colour when displayed

I've taken a screenshot of my iPhone app running and I'd like to use that image as a png to be drawn by the app instead of generated graphics.
When I take the screenshot, it looks fine. However, when that is saved as a PNG file, added to the Xcode project and then displayed back on the screen of the phone (or simulator) the colours are different.
Can anyone explain to me why it's changing? (I'm guessing there's a colour space conversion happening).
How can I stop this from changing?
You might be saving the png image with some incorrect settings which is either reducing the quality or number of colors used. Try the PNG-24 with transparency to see if that helps at all.