Open cannyboy opened 12 years ago
Apps with vertical tab bars, like Instapaper and Spotify, often have tabs at the bottom, separated from the main tabs.
I did this with NGTabBarController, by adding a BOOL property to NGTabBarItem:
@property (readwrite, assign) BOOL atBottom;
Then I changed some code in NGTabBar.m
// re-position each item starting from current top/left for (NGTabBarItem *item in self.items) { CGRect frame = item.frame; frame.origin.y = currentFrameTop; frame.origin.x = currentFrameLeft; item.frame = frame; // move to next item position if (NGTabBarIsVertical(self.position)) { currentFrameTop += frame.size.height; currentFrameTop += appliedItemPadding; } else { currentFrameLeft += frame.size.width; currentFrameLeft += appliedItemPadding; } if (item.atBottom) { item.frame = CGRectMake(frame.origin.x, (self.frame.size.height - frame.size.height)-appliedItemPadding, frame.size.width, frame.size.height); } }
Only works for vertical tab bars, so would probably need a more robust system.. perhaps like UIToolbars with fixed and flexible spacing items.
Apps with vertical tab bars, like Instapaper and Spotify, often have tabs at the bottom, separated from the main tabs.
I did this with NGTabBarController, by adding a BOOL property to NGTabBarItem:
Then I changed some code in NGTabBar.m
Only works for vertical tab bars, so would probably need a more robust system.. perhaps like UIToolbars with fixed and flexible spacing items.