BROptionsButton icon indicating copy to clipboard operation
BROptionsButton copied to clipboard

when the app launches,there will be a part of button below the current button,how can I fix it

Open ghost opened this issue 10 years ago • 3 comments

2015-12-11 20 51 20

and when I presses the button once, it works all fine.

ghost avatar Dec 11 '15 12:12 ghost

any solutions? I'm facing the same

Pratik948 avatar Nov 17 '16 09:11 Pratik948

Btw solved it! 👍 lol, Just added leftRightMargin in openedImageView frame

- (void)setupSubviews {

    const CGFloat leftRightMargin = 10;
    const CGRect imagesRect = CGRectInset(self.bounds, leftRightMargin, leftRightMargin);

    UIImageView *closedImageView = [[UIImageView alloc] initWithFrame:imagesRect];
    closedImageView.contentMode = UIViewContentModeScaleAspectFit;
    closedImageView.backgroundColor = [UIColor clearColor];
    [self addSubview:closedImageView];
    self.closedStateImage = closedImageView;

    UIImageView *openedImageView = [[UIImageView alloc] initWithFrame:imagesRect];
    openedImageView.contentMode = closedImageView.contentMode;
    openedImageView.backgroundColor = closedImageView.backgroundColor;
    openedImageView.center = CGPointMake(openedImageView.center.x,
    openedImageView.center.y + leftRightMargin + (closedImageView.frame.size.height));
    [self addSubview:openedImageView];
    self.openedStateImage = openedImageView;

    openedImageView.autoresizingMask = closedImageView.autoresizingMask = [self allAutoresizingMasksFlags];
    openedImageView.translatesAutoresizingMaskIntoConstraints = closedImageView.translatesAutoresizingMaskIntoConstraints = YES;
 }

Pratik948 avatar Nov 17 '16 09:11 Pratik948

i guess we should close this issue

Pratik948 avatar Nov 17 '16 09:11 Pratik948