Black Bar at top of SplitViewcontrollers Navigationcontroller? - xcode

This is only for landscape mode on the iPad because in portrait mode it was sorted by adding popovercontroller.popoverLayoutMargins = UIEdgeInsetsMake(1,0,0,0);
There is a splitVC with a detailVC and navVC added which controls a rootVC.
This also does not happen in iOS 6 only iOS 7?

Are you sure that you do not have a UINavigationController inside a UIViewController (besides the Split View controller)?
It also seems like you're using a custom background image. Make sure your background image is not 44pt tall (which is fine on iOS 6). On iOS 7, it should be 64pt (128px on a Retina) to correctly extend into the status bar area.

Eventually the only thing that worked here was hiding the status bar all together. This was done in the plist file by adding :

Related

Search Bar and button placed improperly in landscape view despite constraints

I'm trying to add constraints to my button and search bar elements and they work fine in Portrait mode on multiple platforms including ipad, but as soon as I change to landscape view everything brakes and constraints showing conflicts on Iphone's only. Interesting is the fact that Landscape mode on Ipads is completely fine, and works as I imagine it to. I'm new and learning so might have overlooked something, does anyone have any ideas why this weird behavior?
Project has no fancy structure, just pulled up a default single page template on visual studio and dropped a button and SearchBar.
Adding a gif below with the storyboard I'm working on:
Cause:
Let's take iPhone 8 as an example:
The size of iPhone 8 is 375 × 667. In your case, in Portrait mode, you set your button vertical spacing to top equals 200. And you set your button vertical spacing to bottom equals 200. It's ok because the is still enough space for button(button's height is 667-200-200 = 267).
While in Landscape mode, you will found there is no enough space for button.(375-200-200 = -25). So you get conflicts.
Landscape mode on Ipads is completely fine, and works as I imagine it
to.
This is probably caused by the height of Ipads is enough to support the constraints as we know iPad is bigger than iPhone.
Solution:
Pay attention to the cause I mentioned above. You can also specify the size of button.

iOS Black bar issue when using auto layout

I am using Auto layout in my app. I have added constraints on my view. It is working fine in all iPad simulator and iPhone 4s. But when I run this app on iPhone 5s or greater it is showing black bar on left and right side of the screen.
I have also faced this same issue, when I am converting my iPad app to Universal app.
Ref below Image: You can see Main Interface is not set
After that add LaunchScreen.storyboard to your project if not exists.
Ref this Image: Goto your ProjectName-Info.plist add following key
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
Now run the project
Go to your Storyboard. Click on the UIView. Click on the third icon in the auto-layout stuff on the bottom. Now click all of the red line things in the top (stuff circled in pink in below picture) to be set at zero.
EDIT: another possibility is that you have constrained the size of the view in some way. I would try doing reset to suggested constraints, and then set the constraints illustrated above for the background (grey) view so it fills everything up, but do not set it to have an explicit size.
EDIT 2: If that grey thing in the background is a UIImage, I bet the issue is that it is in Aspect Fit. Change the content mode to Aspect Fill and I think it should work.

Text starting at wrong position in textview in Xcode 6

There's no code involved at the moment, only storyboard or xib files as far as the textview is concerned. This is what I get when running the app on my iPhone 5s or via the simulator.
I'm using auto layout and size classes with the option any width-any height. An imageview at the top, then a label, then the textview.
Here's a picture of the screen. As you can see, it looks as if the text is starting behind the label, but the textview's y is after the label and the constraints seem all correct according to Xcode 6. It works fine on iPad.
Any idea of what I'm doing wrong?
I've found a way round it: textview should have no scrolling enabled and should be put in a scrollview instead, which will do the actual scrolling. Need to add constraints to both.

iOS 8 AutoLayout + UIScrollView: Preview OK, Build UIScrollView empty

I have a weird problem: I use Autolayout for a UIScrollView with child views, and when I show the Preview everything looks fine:
But when I build the app the content is not shown correctly, seems to be an content size issue.
I pinned all of the child views correctly, didn't set any content size (as should be with autolayout scrollviews), but I can't get the scrollview work with correct content size.
Anyone that can help me on that?
Thanks!

In iOS7 Text Magnifier isn't working app wide

I have a came across a rather annoying bug in one of my apps. In iOS7 when I hold down on a UITextView or UITextField to bring up the Magnifying Glass, nothing shows up in the magnified area. This problem is app wide and the only element that ever shows up in the circle area is the keyboard itself (when I drag my finger down to the top of it).
I have tried everything from View Controllers with only a single UITextView to UIWebView and the problem is app wide.
The magnifying glass works as expected on iOS6 devices, and the iOS7 simulator. But not on any of the devices I have tested it with running iOS7.
Any help would be greatly appreciated.
I fixed this by setting the windowLevel of my main window to a float value of 1.2 in appDelegate:
self.window.windowLevel = 1.2;
This is a sort of hack for iOS7 to raise the default level of your main window which is UIWindowLevelNormal (1.0) to 1.2
Had the same issue when using multiple windows at once. Setting correct .windowLevel value for each window for correct z-sorting solved the problem.
We have a similar problem where we were presenting a UIWindow over the top of the existing window and if they have the same windowLevel then the loupe displays the first window added.
example:
[applicationWindow (windowLevel = 0] <------------- [customWindow (windowLevel = 0)]
customWindow renders on top of applicationWindow just fine...but a loupe displayed over a textfield in custom window renders the contents of applicationWindow.
[applicationWindow (windowLevel = 1] <------------- [customWindow (windowLevel = 1)]
Same result. customWindow renders on top of applicationWindow just fine...but a loupe displayed over a textfield in custom window renders the contents of applicationWindow.
[applicationWindow (windowLevel = 0] <------------- [customWindow (windowLevel = 1.01)]
customWindow renders correctly, contents of loupe render correctly.
The way we solved it is by initing customWindow.windowLevel to be UIApplication sharedApplication].keyWindow.windowLevel + .01 (but this could be anything) before making our customWindow the keyWindow. Thanks #user2940692, your answer should probably be the accepted one... if you want it, i'll post our case as a question, you can answer it and I'll give you credit.
I had the same issue. I found that in Project -> Targets -> General that there was a nib listed in the "Main Interface". Once I removed that it works fine. I also tried setting the window level, and it worked, but it was just masking the true problem for me.
If you did not get any help from the above solutions, I found another problem which can cause this to happen. I had a UIWindow object in nib which was initialized in AppDelegate. That view had background color as [UIColor whiteColor]. Setting it to [UIColor clearColor] will resolve this problem.

Resources