iPad UITableView top right corner covered with white box in landscape popover - ipad

I am attempting to create a custom popover for an iPad application in landscape orientation. I created a new UITableViewController with static cells on my storyboard and set the size setting to "free form". I then set the size of the UITableView to my desired size. I connected a Modal segue from the parent controller to the new popover.
Then in the parent UIViewController I created a method that performs the segue through a custom presenter. After working through a bug in Apple's orientation handling routines, I got the popover to show at the correct location.
When I run the app, I then discovered that in the top right hand corner of the UITableView a white box is displayed that covers whatever I place in the UITableViewCell. The more cells I place in the table the longer this white box appears. So I believe it has something to do with the UITableViewCell not orienting properly although I have not figured out what yet.
I cannot seem to find what this box is, nor have I had any luck getting rid of it. Has anyone seen something like this? Any help to get this white box remove (or whatever is needed to get the cells working correctly again), will be greatly appreciated.
Thanks in advance

For anyone who is interested, I was able to work around this problem. It turns out that there is a bug in the modal segue logic that does not handle landscape orientation. So I created a XIB and presented that as my modal view. I still need to adjust things since it is landscape but the view displays correctly.
From what I understand this storyboard bug should be fixed soon.

Related

XCode can't fix landscape orientation layout in storyboard

I have a simple linear chain of UIViewControllers.
The first one has a show segue to a NavigationViewController, then it goes on the same way with all the others.
When I switch from wCompact-hRegular to wRegular-hCompact to fix the landscape layouts the first viewcontroller doesn't allow me to do anything. The tree diagram at the left side of the storyboard screen shows the views but they are not written in black. They are transparent. Even if I select them and put the coordinates or dimensions nothing happens. There are only a button and a label. Others Controllers are all ok, they can be fixed. What is happening to the first one?
With XCode 6 you can add views, that are only visible in the selected size class (f.e. Compact + Compact). When you change to a different size class the views are disabled. To fix this navigate to the attributes inspector and select installed for any class sizes.

Empty navigation bar appearing in subview

I am trying display a UITableView within a larger UIView in an iPad app, mainly because the data is pretty sparse and I'd like to have the table be a smaller area over a background image, rather than taking up the whole screen. The parent UIViewController is correctly set as the table data source and delegate, and the table looks/functions like it should. The whole view is embedded in a navigation controller; the overall UIView shows a navigation bar, as it should, that I can configure normally.
The problem is the UITableView subview also shows blank space at the top for a navigation bar--empty space above the first cell--and I can't figure out how to get rid of it. I know the space is related to the navigation controller, because when I delete the embed link in the storyboard, the space goes away. The table view doesn't present a UINavigationBar property or any other navigation-related properties that I can try to nullify.
I would post a screen shot but I don't have the rep yet.
Can anyone explain where the space is coming from and how to nix it?
I suspect the answer is related to the Top Layout Guide for the view, but I can't diagnose the specific problem.
Here's a workaround from the storyboard: Insert a UIView in the scene, then drag the UITableView into it as a subview. Check the box for the new UIView's "Clip Subviews" in the attribute window, and then use it as a mask, basically, to cover the undesired top margin of the table view. It works and doesn't require any coding, but there has to be a better way.

Strange black dim under UINavigationBar

Recently I've faced a strange thing in my app. I don't know if this is a bug but it's annoying.
I've a view hierarchy like on the screenshot below:
... and when I move my app to the background (tapping on the home button) there appears a black dim under UINavigationBar. Of course it stays in the task-switching mode (screenshot below). I don't know what caused this bug and of course I don't know how to get rid of this.
I wasn't able to fix this problem directly but as I said it is a problem with hierarchy and I'll try to explain it just the way I understand it so if I'm wrong, don't hasitate to correct me!
UIView called Groups is filling only the space under the UINavigationBar. In that case there is nothing under the bar. So why is it displaying this dim? I guess because of the native blur effect under UINavigationBar.
So how did I manage to deal with this without changing the view hierarchy? I've changed the size of UIView to cover whole window and because UIView has some backround set the dim effect disappeared. This operation is easy to achieve. Just by selecting Extended edges Under Top Bars option in Attributes Inspector of View Controller

UISplitView with UITabbar

I have a strange one that I can not seem to fix. I am currently working on updating my app to iOS7. This all worked in iOS6. It is an universal app and thus uses same xib files. However the iPad uses UISplitViews on some. Like I said, this all worked in iOS6 oh this all works on the iPhone too.
The problem is a grey bar at the bottom. I changed the tab bar to be opaque to move views up properly as i had some UI clipped to bottom of views and that went underneath the tab bar, sidetracked there. But if i set it back to translucent bar, it goes underneath but stretched properly. if i dont, it adds a bar. Other tabs work fine when NOT using splitview.
The UISplitviewController is added programmatically.
See attached image for better description.
This I have tried:
Added autoresize on splitview
Checked xib for subviews in the splitviews to have auto resize
Tried to force splitview to be screen bounds
Removed clips to bounds on all views
Removed autoresize subviews
Any ideas would be welcomed.
Thank you all.
UPDATE:
setting the background colour the uisplitview, it does colour the bar black. So the uisplitview is definitely stretching to it.
I subclassed UISplitViewController and added the line below to viewDidLoad and that fixed the grey line.
self.extendedLayoutIncludesOpaqueBars = YES;
I believe I have found an alternative solution for you. I have had the exact same problem, mostly because we are both doing something against Apple's Guidelines which is having a SplitViewController nested within a Tabbar controller (SplitView should be the root view). This was okay in iOS 5/6, but now in iOS 7 there are far too many side effects to achieve this.
The reason you see your view stretch completely when you set the bar to be translucent is because the bar is NOT taken into account when drawing the view. When you set translucent to false, it is then taken into account of the view and you will see that grey bar there because that's your view pretending there's a tabbar at the bottom of the screen.
And as always, a SplitViewcontroller's height cannot be changed, as it is determined by the visible window height.
I tried everything you did and then some. The real solution came from using a third-party Split View Controller.
I recommend switching over to https://github.com/mattgemmell/MGSplitViewController . This split view controller is actually one large View with container views living inside of it. Because of this, you avoid all the side effects of putting an actual split view controller within a tab bar.
If that doesn't float your boat, you could create your own solution which follows the same idea of having one UIViewController with two container views contained in it, though the people behind MGSplitViewController did a good job of that already.
This was the only way I was able to solve this issue, let me know if you find an alternative.
Instead of creating a subclass for UISplitViewController, I just added this code on my master's viewDidLoad:
self.splitViewController?.extendedLayoutIncludesOpaqueBars = true
For the controller that is the detail view of UISplitViewController you just do this:
-(UITabBarController*)tabBarController{
return nil;
}

Toolbar hiding on rotated UISplitView DetailView

I've based my app on Apple's SplitView project type. I have a TableView as the Master, and am using different types of views as the Detail view. To select types of detail view, I'm using the fancy concept of buttons on my DetailView toolbar. When the DetailView is derived from UIViewController, everything is good. When the DetailView derives from UIViewController, but contains a UITableView then I have problems. In portrait view the toolbar is visible. In landscape mode the toolbar is hidden, even though the Tableview is moved down to allow space for it. The UIToolbar and UITableView are both defined in my NIB file which is loaded to create the detail view. Why is my toolbar invisible in landscape?
BTW, is this the best way to choose Detail view types with UISplitView? Bonus question, what if selecting a row in my DetailView tableview should bring up another View, I can't push it like I would with a NaviagtionController, so how do I go back to the detail tableview?
Thanks, Gerry
HI Gerry,
I have faced the same toolbar problem, when trying to rotate the splitView, toolbar will disappear. If you are creating the toolbar in the interface builder, try to set the toolbar properties(size), by selecting the toolbar, then --> Tools -->Size inspector, in the autosizing section, mark the left, right and upper red lines and unmark the bottom red line, then everything will works fine.
-Maria
Bonus question, I would create a UINavigationController in code, set it's rootcontroller to the DetailView tableview (self) and then push the new view on top of it.
When you react to the rotation change are you using the same view or a different one for the detail view? Seems like the new view may not contain an instance of the toolbar? Or the Tableview is covering it up because the landscape view has less vertical room than the portrait view. Are you resetting the height of the tableview to allow space for the toolbar within the 768 height when rotating to landscape?
Just a tip but whenever I run into odd things like this I remove the elements from the NIB file and create them programmatically in code and it usually solves the problem. You get a lot more control over things when you do. Overall as I've gained more experience with programming for iPhone OS I've found that I rarely put much into a NIB file any longer and do almost everything in code now.

Resources