I have a relatively simple app that runs perfectly on the simulator, but when I try and run the exact same application on an actual device I get something different, my container view shows up as completely black and elements within the content view don't show up.
Here are some images:
Xcode:
Simulator:
Actual device (iPhone):
It turns out the problem was that I had alpha of that UIView to 1 and so changing that value fixed it
Related
I would like to make screenshots of my app in IOS-Simulator. This works fine with CMD-S, but I have always black parts in my screen, because the windows is not autosized to the simulated devices screensize.
Is there a way to autosize the window to fit with the screensize of the simulator ?
Screenshot:
The white part is the content of the device. The black is obsolete and is a window from the MAC. When taking the screenshot from this, I still have to cut out the content to have a good screenshot.
This used to happen in earlier to iOS SDKS when you don't set a launch images for all devices.
In your case, I think you don't have the launch screen file set. this can be solved by setting that file at general section in the target's settings.
Alternatively, set launch screen images for all devices.
Check my answer here.
One more thing to try: At the top bar in simulator. choose the
Window menu then Scale and play with those values.
I solved it the following way, but I don't know what was the reason.
I removed the launchscreen as hasan83 suggested. This did not the trick yet.
I restarted the MAC
I started XCode ("Xcode"->"Open Developer Tools"->"IOS Simulator")
I started the ios simulator without starting my app. -> MAC-Windows fit with the simulated device screen
I started my app and now it looks as intended.
Thanks for helping to all involved people !
So I am running a simple ViewController in swift and it when I run it, on the simulator it looks fine but on my iPhone it doesn't.
Here is how the background looks like on the simulator(correctly)
"simulator"
and here is when I run it on the iPhone
"iPhone"
They are both just images that I uploaded (this includes the dividers, 'pounds', and 'repetitions' while the logo on top and button in the bottom are part of the window.
So because of this, I know the problem is in the background but I tried going setting by setting to compare them to other Views that do work and can't seem to find the answer. Anyone have any ideas?
I've got a UITableView with separator set to Single Line.
On iPhones <= 5s everything looks fine, but on 6 and 6 Plus (device as well as simulator) the separators have a different thickness. It's even worse as they're flickering while scrolling which looks pretty bad. I don't set the height manually, so I have no idea what's causing this.
As you can see, the first two lines are a little bit thicker than the next two. Now if I scroll, they change from thick to thin and back, so it looks like flickering...
The problem is that your app doesn't support native resolution for the iPhone 6 and iPhone 6 Plus. Therefore it gets scaled up which results in the flickering.
You can enable native resolution by adding iOS8 launch images. Then your app will run in the right resolution and this problem will be fixed.
Add
Renders with edge antialiasing: YES
In you .plist file
Aqua is right, the thickness and flickering problems go away if you add iOS8 launch images.
But you don't need to make actual launch images if you are using storyboards. In Xcode, select your overall project and your app target, then under the General tab find App Icons and Launch Images, then in the Launch Screen File popup, just select your storyboard and the thickness/flickering problems go away.
When i created App the launch image was correct and now its almost a month but when i run the app in device and simulator the splash screen is just inverted!!! i don't know why ???
Please check the attached images,Images are correct but when they
appear inside device or simulator its inverted
I have tried to remove the images and add it gain ,its not working .
Then i have created a new asset catalogs and added corresponding images.But now in iPad 3 its coming correct but iPhone its still wrong
Go to your plist file and look for Supported interface orientations (iPhone)
you will see some thing like the below attached image.
Make sure the sequence of the orientation levels is as shown in the above screen shot.
It worked for me. give it a try.
I need your help. I have designed an app to target iPhone only and everything works fine. However, I just realised that when I run it on iPad, I get black spaces around the screen (view doesn't cover full screen of the iPad) and strangely, the bottom part of the app gets cut off when it runs on iPad. How do I get full screen iPad mode without part of the view getting cut off. Thanks
This is normal behaviour(black spaces around the screen) if the value for "Devices:" under Target/deploymentInfo is set to iPhone. In this case you can still test on iPad but with iPhone resolution. (but if it set to iPad you can not test on iPhone).
if you want to get iPad resolution you have to change "Devices:" value to universal.
for (bottom cut) check if your code uses device size for positioning buttons.
Your app must also run on iPad without modification as for
2.10 App Store Review Guidelines
At first, you have to set your the view (on Main.storyboad) to fit all size. That is `wAny hAny).
Then selected the views, add some constrains to them one by one. When you run the app, it should be right. If the position doesn't match your expectation, you can change the constrains. You should know things about AutoLayout. Find some article to read, and practise.
Thanks guys for all the comments. Using your comments and reading and testing AutoLayout features, I am able to solve the problem.