UIViewController in UITabBarController is Black - uitableview

I have a UITabBarController with 3 tabs. One of the UIViewControllers, which controls one of the tabs, is a UITableViewDelegate and has an embedded UITableView which uses a portion of the screen. There are some buttons that appear below the UITableView.
This UIViewController generally works, but if I make changes to the code (could be in any file), sometimes this UIViewController will display nothing but black between the Navigation Bar and the Tab Bar. I can switch to other tabs and they act as expected.
Even stranger, if I go to the Storyboard and change the order of the tabs, then the problematic UIViewController starts working again. All I am doing is changing the order of the tabs ...
Any ideas about what is going on here?

I'm no expert on swift, but I've spent lots of time with tab bars and UITableViews inside of UIViewControllers. Here are things that I would check/do:
reset my simulator (run it, and use the simulator menus)
clean my build area
change the table view background color to red
change the table view tintColor to green
change the outermost view background color to yellow
change the outermost view tintColor to blue
now when it goes black, maybe it will show another color
check, and double check the constraints on the table view
the blackness might be caused by no cells getting displayed, or by the whole table view losing its sizes somehow

Related

Gray bar visible on iPhoneXS throughout app

Header image with gray bar on top
I am converting our app to fit correctly on newer iOS devices. We are using xib files for the UI. I added a launch screen storyboard to start off the new formatting. I noticed a gray bar across the top of every screen. It is not part of the view controller and I've tried removing the status bar but that only makes the text and icons disappear. I don't think it's the navigation bar either since we have that hidden as well. I have checked the Safe Area Layouts.
Any ideas on what this is and how I can remove it to extend my view all the way to the top? The blue in the image is the color I currently set the background of my view controller and we have a custom header view below that.
Using the View Hierarchy, as suggested, I was able to see the view behind my main view. I inspected the code for that initial view and found the previous developers had offset the Navigation Controller by 20. That is what created the bar on all the views. I have adjusted to remove the offset and it looks perfect now.

Swift - Segue between Views with different titleDisplayMode shows a black bar

When I'm doing a segue between views with largeTitle on in the first and off in the second there is always a black bar while the animation from large to small runs. Is there any way to fix that? Can I change that color?

iOS 7 Status Bar Empty Space

I have an issue where a white space is being created where I think my app thinks it needs a status bar.
I have a UIViewController, embedded in that is a UITabBarController. The UITabBarController then just displays UIViewControllers as normal.
When the app first loads (iPad iOS 7), everything works as expected, only inside that UITabBarController, the UIViewController (displayed by the UITabBarController) is offset downwards by 20 pixels. The space for a UIStatusBar.
When I say offset, the UIViewController doesn't fall off the bottom of the screen, it just gets shorter to add that 20 pixel space.
This started happening after I enabled the status bar in my Info.plist with View controller-based status bar appearance = YES.
The app only does this when it initially loads. After I change the tab to show a different UIViewController, the space disappears.
Any ideas why this is happening and how I can stop this? Thanks.
I can't comment yet, but wasn't there a warning, when you tried to place a tabbarController inside of a navigationController? Last time I tried this, XCode threw some warnings regarding the order.

How to make a view controller appear from the left and to not fill the full view?

How to make a UiViewController appear from the right of the screen, the same way as this application(Break) does on iPad.
https://itunes.apple.com/us/app/funny-videos-pics-by-break.com/id342257973?mt=8
In fact, I would like that my UIViewController appears on the screen from a side and not to fill the entire UIView of my main ui view controller. The background view should also be darken.
To sum up, I would like to mimic the same Break's behavior.
Here is a picture if needed
Any idea ? Thanks for your time !
You may need to just do some manual work with UIViews. So rather than push a viewcontroller onto the stack you would overlay a semi transparent black view over your background view to darken it and then simply do an addSubView of the view you want to show on top.

storyboard: table view appearing behind navigation bar

As per the picture below, part of the TableView is appearing behind the Navigation Bar.
I had been ignoring it, thinking it was just the way the storyboard drew things because it looks ok in the app. But it can be problematic - sometimes, to select the cell behind the Navigation Bar, one needs to use the Document Outline.
Is that just how it goes? Or is there a way to get Xcode to draw things properly?
It looks like you have selected a translucent navigation bar which will not push down other subviews. Try using the standard or black navigation bar. It probably looks fine in the app because your navigation controller using the non-translucent bar.

Resources