THPinViewController icon indicating copy to clipboard operation
THPinViewController copied to clipboard

Cancel button always has white text

Open mreynolds0404 opened this issue 6 years ago • 3 comments

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 avatar Aug 29 '17 20:08 mreynolds0404

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;
    }

}];

mreynolds0404 avatar Aug 30 '17 12:08 mreynolds0404

@mreynolds0404 , this fixes title color

[cancelButton setTitleColor: darkBlueColor forState:UIControlStateNormal];

ekrivenja avatar Nov 04 '17 22:11 ekrivenja

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

assembleMHN avatar Jan 31 '18 11:01 assembleMHN