Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Good day, dizy.</p> <p>A nice challenge you've made. Here is a solution, maybe it's a bit hardcore, but it works.</p> <p>I've done as you wrote – subclassed UITabBarController and presented it as a modal view controller. And run into the same problem. When tapping "edit" button in "More" screen UITabBarCustomizeView appears and it's frame is inadequate.</p> <p>So I've done the following. I've made MyModalTabBarVC a delegate of itself and implemented <code>tabBarController:willBeginCustomizingViewControllers:</code> method:</p> <pre><code>- (void)tabBarController:(UITabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray *)viewControllers { UIView *modalView = self.view; CGRect bounds = modalView.bounds; UIView *customizationView = [[modalView subviews] objectAtIndex:1]; UIView *customizationNavBar = [[customizationView subviews] objectAtIndex:0]; CGRect navBarFrame = [customizationNavBar frame]; navBarFrame.size.width = bounds.size.width; customizationNavBar.frame = navBarFrame; customizationView.frame = bounds; } </code></pre> <p>So when this method is called <code>UITabBarCustomizeView</code> is already created. And a wrong frame can be changed manually. If you log <code>po [self.view subviews]</code> at the start you'll get: </p> <pre><code>(id) $1 = 0x06c6a940 &lt;__NSArrayM 0x6c6a940&gt;( &lt;UITransitionView: 0xd744ab0; frame = (0 0; 540 571); clipsToBounds = YES; autoresize = W+H; layer = &lt;CALayer: 0xd744b50&gt;&gt;, &lt;UITabBarCustomizeView: 0x6c5e570; frame = (0 -384; 768 1004); animations = { position=&lt;CABasicAnimation: 0x6c569a0&gt;; }; layer = &lt;CALayer: 0x6c618d0&gt;&gt;, &lt;UITabBar: 0xd744110; frame = (0 571; 540 49); autoresize = W+TM; layer = &lt;CALayer: 0xd742b80&gt;&gt;, ) </code></pre> <p>PS. This solution doesn't fix animation. As you can see from log, corrupted animation is already created and charged. I hope that canceling it and adding a new one, appropriate, will not be a problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload