Closed latteier closed 7 years ago
I'm experiencing another related issue.
UILabel {
text-color: $Black
}
UINavigationBar {
title-text-attributes: @{
foreground-color: $White
}
bar-tint-color: $DarkerBlue
tint-color: $White;
}
When I view a screen the navigation bar text is white. When I return to the screen after presenting another screen and then dismissing it and viewing the origin screen again, the navigation bar text uses the regular UILabel settings (text is black).
This seems related in that property selectors don't seem to being applied when a screen is viewed after returning to it via dismissing a view controller.
An update: the problem doesn't happen when popping view controllers (as I earlier claimed), instead it happens after dismissing modals via dismissViewControllerAnimated:completion.
Sorry for the inaccurate information earlier.
Sorry been busy with work! Does it help if you add the following to the view controller in question?
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self cas_updateStyling];
}
Thanks for the suggestion, unfortunately it doesn't solve the problem.
@latteier Did you ever resolve this? Did you try placing the call to cas_updateStyling in the completion block of dismissViewControllerAnimated?
@latteier , please close this issue if it no longer applies.
Probably best to close this. I haven't looked at this stuff in a long time.
I'm having a problem with styles applied via properties not working when a view is re-displayed.
I define a default font for UILabels within a view controller and override this setting for the subjectLabel.
This works fine. But when I present a view controller, and later dismiss it and return back to this view, the settings for the subjectLabel aren't used -- it uses the default UILabel settings.
If I change to using a cas_styleClass selector rather than a property selector everything works correctly.
Thanks for your help!