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

Paper button and paper cell got covered by gray tap circle or dark gray color when swipe back from one view controller to parent view controller #6

Closed
yeahdongcn opened this issue Aug 31, 2014 · 13 comments

Comments

@yeahdongcn
Copy link
Contributor

I have meet his problem when using BFPaperButton and BFPaperCell, here are screenshots taken from my phone.

@bfeher
Copy link
Owner

bfeher commented Sep 1, 2014

R0CKSTAR, thanks for filing this bug report!
Am I correct in believing that tapping a BFPaperButton/BFPaperTableViewCell pushed a new view on the Navigation Stack?
I'll be investigating this issue this week. Hopefully I can release a fix soon.

@bfeher
Copy link
Owner

bfeher commented Sep 1, 2014

Sorry, I have another question:
Are you setting the tap-circle color to that gray? Is that gray to be expected?

@yeahdongcn
Copy link
Contributor Author

I'm using smart color but always select gray, I don't know why. Please also investigate this...

@implementation ZSHPlainButton

- (void)dealloc
{
    NSLog(@"dealloc");
}

+ (instancetype)button
{
    return [[self alloc] initFlat];
}

- (void)action:(id)sender
{
    if (self.click) {
        self.click(sender);
    }
}

- (void)setup
{
    self.cornerRadius = 0;
    self.isRaised = NO;
    self.usesSmartColor = YES;

    [self addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchUpInside];
}

- (id)init
{
    self = [super init];
    if (self) {
        [self setup];
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setup];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self setup];
    }
    return self;
}

@yeahdongcn
Copy link
Contributor Author

The last question is YES, pushing a new view controller than swiping back, and the screenshots are taken from intermediate states, when the last view controller receives viewDidAppear, everything goes right.

@bfeher
Copy link
Owner

bfeher commented Sep 1, 2014

About the gray color:
If you use smart color, BFPaperButton tries to match the color to self.titleLabel.textColor and BFPaperTableViewCell tries to match the color to self.textLabel.textColor. Are you setting these properties?

Is the circle still gray if you explicitly set the tap-circle color (eg: control.tapCircleColor = [UIColor redColor];) ?

@yeahdongcn
Copy link
Contributor Author

.tapCircleColor = [UIColor redColor]; this will change the circle color.
It could be smarter if considering the background color or background image color or image color for certain state :)

https://github.com/timominous/TDImageColors

@bfeher
Copy link
Owner

bfeher commented Sep 1, 2014

I see. Thanks I will take a look and perhaps include the ability to choose where smart color looks to match the circle in the next version.

As for the animation getting paused and resumed by the Navigation Stack transition animations, I really don't know if that is something I can control from the UIButton level. It seems like the animation is performing as expected, but I will continue looking into this.

Thanks.

@yeahdongcn
Copy link
Contributor Author

Thanks for taking time investigating this.

@bfeher
Copy link
Owner

bfeher commented Sep 1, 2014

I just confirmed this strange and unwanted behavior:
circle-bug-safe

Will work on a fix for this ASAP.

Thanks again for finding this!

@yeahdongcn
Copy link
Contributor Author

Great, looking forward to your fix, thanks.

@bfeher
Copy link
Owner

bfeher commented Sep 1, 2014

Version 1.5.1 fixes the gray layer and circles being left behind and showing up during Navigation Stack transitions, and 1.5.2 is the latest build. Please update and let me know if you find any more bugs, thanks!
(I am rolling the same update to the rest of the BFPaper components today as well.)

I am considering adding options to make Smart Color more smart in the future, thank you :)

@bfeher
Copy link
Owner

bfeher commented Sep 2, 2014

BFPaperTableViewCell version 1.2.1 applies the same fix to that library.

@yeahdongcn
Copy link
Contributor Author

Nice, thanks!

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

2 participants