Skip to content
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

Cancel button always has white text #32

Open
mreynolds0404 opened this issue Aug 29, 2017 · 3 comments
Open

Cancel button always has white text #32

mreynolds0404 opened this issue Aug 29, 2017 · 3 comments

Comments

@mreynolds0404
Copy link

In a previous version, the text of the cancel button label would follow whatever color was set as promptColor, now it is always white, which is a problem when using a white background. Sample code:

THPinViewController *pinViewController = [[THPinViewController alloc] initWithDelegate:self];

pinViewController.disableCancel = NO;
pinViewController.promptTitle = title;
UIColor *darkBlueColor = [UIColor colorWithRed:0.012f green:0.071f blue:0.365f alpha:1.0f];
pinViewController.promptColor = darkBlueColor;
pinViewController.view.tintColor = darkBlueColor;
pinViewController.backgroundColor = [UIColor whiteColor];


[self presentViewController:pinViewController animated:animated completion:nil];

//cancel button not visible

@mreynolds0404
Copy link
Author

If it helps, I tried this as well with no luck:

[self presentViewController:pinViewController animated:animated completion:^{
//work around for styling bug in PIN controller library
id maybeCancelButton = pinViewController.view.subviews[0].subviews[3];

    if([maybeCancelButton isKindOfClass:[UIButton class]]){
        UIButton* cancelButton = (UIButton*)maybeCancelButton;
        cancelButton.titleLabel.textColor = darkBlueColor;
        cancelButton.titleLabel.tintColor = darkBlueColor;
    }

}];

@ekrivenja
Copy link

@mreynolds0404 , this fixes title color

[cancelButton setTitleColor: darkBlueColor forState:UIControlStateNormal];

@assembleMHN
Copy link

Any news on this, cancel (bottomButton) cannot be seen on default layout as it is white.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants