UITableViewCell Background stretching - swift

I have a problem in Swift with UITableViewCell background image. Let's say that it shows quite fine one iPhone5 but on iPhone 6Plus it is stretch and thus it looks bad. This is probably due to Aspect fill or something which I really couldn't manage to change and achieve what I want so would be the best if someone could poke sample code I am providing as well as image how it should look, so anyone can check it out and maybe give me some hint or tip or sample code or even fixed demo version.
So here it is:
Note that on left side there is a curve (like half a circle) around right side of icon. On bigger phones or tablet, that curve gets super stretch thus completely destroying the look.
Demo code link
Thanks all in advance for any help. I am pretty stuck with this one.

You can stretch an image while preserving the aspect ratio of a portion of that image using slicing. Xcode offers a graphical interface for doing this. The idea is that you decide what parts of the image are allowed to stretch and which aren't.
https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/chapters/SlicinganImage.html

Related

UI background changes with the aspect ratio

I am making a 3D game on Unity. Currently I work on main menu. The problem is
when I use 16:9 aspect ratio I get this result:
The background is not scaled.
However when I use Free aspect ratio, I get this:
Here is background object properties and sprite properties:
I have no clue what is the problem here and how to solve it. I hope to find some help here. Thanks in advance.
You should extract one tile of the background sprite like this:
Then it should be tiled correctly.
The key is to extract the smallest repeatable element.
Also, you don't have to worry about the Free Aspect. Just make sure it looks fine on the real screen resolutions.

Unity sprites don't render properly

I recently came across a problem I can't solve which involves not being able to draw my sprites properly. I have tried a lot of different things and couldn't find any solution.
Here is how the image should look like in unity:
And here is how it actually looks like:
If someone could tell me how to fix this, I would be very grateful.
Presumably the top image is a screenshot of your image manipulation program, many of which use the chequerboard pattern to mean transparency. As such, the image you have exported is a gradient going from almost solid white at the bottom to transparent at the top. This is why the image appears as such in Unity.
Also, if you're wondering why the image appears as though it has bands of different colours, this is due to a problem called colour banding. This can be fixed by using a technique called Dither (which adds some noise to the image), but how you do so will depend on which image manipulation program you are using.

Constraints issue in Xcode

I'm having some issues with the constraints in my app. Here is how it looks on the iPhone 4 (that's how i want it to look, and how i usually setup my interface, is this the proper approach or not?)
Now, when i switch to the iPhone 5 screen it looks like this
and as you can see, the blue dots (which is UIButtons) are not placed where i want them to be. I made my constraints rely solely on the right side of the view (since that is the one re-sizing, i found that in order for you'r views to align themselves accordingly, it doesn't help to align them to the left side). I don't really know how to fix this. I am finding this new iPhone screen to be a real pain in the arse. Any good advice on how to work with this new screen without a lot of headache would be appreciated :)
Thanks on advance
It looks to me like the are still the same distance from the right side of your view, as you said you set them to be, while the background has stretched to fit the new size. I suspect it's actually the background that isn't doing what you want it to do (keep the same aspect ratio and show more stuff on the left), or try keeping the buttons relating to left and right to stay aligned with the stretched background image.

Why does my text look so bad in my ios App?

I have a uiscrollview that has a custom child view that contains text and images.
The text items are UILabels. I have attached an image representing the quality issue:
Do you guys think it might be worth a shot to draw the text, then convert to a uiimage and display that instead? Maybe it would scale better? Or perhaps there is a way to smooth the text?
There's no reason to expect that you're going to draw the text better than UILabel does. Your picture is very hard to make out, but here's what you want to look at:
Are you just adding a UILabel to the UIScrollView's contentView, or are you doing something else fancier. That "something else fancier" could easily be the problem.
Make sure you're drawing on pixel-aligned boundaries. The easiest way is to make sure the origin of your UILabel is integral (not a fraction). On a retina display, you can get away with half-points, but it's usually easier just to make everything integers.
I thinks it is the position issue. I bet you set the x or y value to float value like 12.3 or 12.5 .
What I have done now is I have created a uiimage version of my text and am showing that now instead of the uilabels, the quality is soo much better, you can really see the difference when you are looking at it scaled up on the ipad, it must just do a better job scaling images then text?
Before:
After:
The above images show how the text renders on the ipad with my app scaled up, before and after my change.

UIImage resize, crop and rotate with frame

I'm searching for library or just code snippet to provide function like resize, crop with frame and rotate image after user pick image from image picker. Something like on this video: http://www.youtube.com/watch?v=Gb6xncXg1PY (0:55). Maybe someone has the same issue?
This one could help you relating the images. It's for iPad but this shouldn't make much differences. The principles should be the same. (icodeblog.com is really a good page, could be that there is much more relating this issue)
http://icodeblog.com/2010/10/14/working-with-uigesturerecognizers/
But there are also so much out which you can find via Google. I had a good one but I don't find it anymore.