-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bar Button Items in Navigation Bar loose textcolor after modal view did cover them #2
Comments
I've tried to replicate this programmatically by presenting a modal view controller, but it works fine for me. Perhaps this is a segue/storyboard issue? https://www.dropbox.com/s/u3obaxwhj1b2bb2/nav%20item.mov?dl=0 |
The issue only happens when using a text button bar item, not with system or image bar button items. https://www.dropbox.com/s/ycbah06bz8sctj5/MAThemeIssueDemo.mp4?dl=0 |
Ahh indeed.. Very weird. At first glance this looks like an OS bug, as my code isn't doing anything after viewDidLoad, so perhaps there's a bug in the appearance proxy methods. |
Just found and fixed it! #pragma mark - UI Navigation Bar Button And in the method setupThemeWithPrimaryColor add this line after customizeNavigationBarColor: Text now also gets the textcolor when the button is contained in a UINavigationBar, even after being covered by a modal screen. Yay! |
Very weird, thanks for that, I'll incorporate the fix in a moment.. It does seem to be an OS bug, in that you need to set both the line you added above as well as |
17e0476 Should fix it. Let me know how that works. |
Issue fixed! Thanks. |
No, thank you! |
Bar Button Items in Navigation Bar loose textcolor after modal view did cover them
Steps to reproduce:
Make a single view app project with a storyboard.
Change the appDelegate by adding some imports and the code:
In didFinishLaunchingWithOptions:
{
// Override point for customization after application launch.
[MAThemeKit setupThemeWithPrimaryColor:[MAThemeKit colorWithR:0 G:184 B:156] secondaryColor:[UIColor whiteColor] fontName:@"HelveticaNeue-Light" lightStatusBar:NO];
return YES;
}
Embed the single view in a navigation controller using Editor Embed in...
Add a new viewcontroller
Add a Bar Button Item called test, do not specify an image.
Add the following code to the first viewcontroller for the exit segue:
-(IBAction)closeTest:(UIStoryboardSegue *)segue {
NSLog(@"Pop to first viewcontroller");
}
Drag a modal segue from test to the second view controller
Put a button in the second view controller
Drag from this button to the exit icon in the first viewcontroller
Run the project. Everything receives its correct color: navigationbar, title, button bar
Press test, the modal view covers the screen
Press the button, the exit segue is called and the modal screen disappears.
Now the first view has the correct colors for the navigationbar and the title, but the text in the bar button item is only slightly darker than the navigation bar.
Strangely enough: when using an image instead of text, it works ok.
See attached screen shots
The text was updated successfully, but these errors were encountered: