chrismiles / CMPopTipView

Custom UIView for iOS that pops up an animated "bubble" pointing at a button or other view. Useful for popup tips.

Home Page:https://github.com/chrismiles/CMPopTipView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some PopTip views do not resize properly

SamB2B opened this issue · comments

I have three pop tip views in my application, two of them do not resize properly when they appear on screen:

1:
screen shot 2014-03-13 at 9 27 58 pm
2:
screen shot 2014-03-13 at 9 28 07 pm

3:
screen shot 2014-03-13 at 9 28 18 pm

They all have a title and message, 3D style is off.
Why is this?

Good question. Can you post the code you use to create the views? Or share an example project that shows the problem?

if (element == 1) {
CMPopTipView *popTip = [[CMPopTipView alloc] initWithTitle:@"Start Here" message:@"Create a new calculation"];
popTip.delegate = self;
popTip.backgroundColor = [UIColor clearColor];
popTip.textColor = [UIColor whiteColor];
popTip.has3DStyle = NO;
[popTip presentPointingAtView:self.calculationButton inView:self.view animated:YES];
self.calculateTip = popTip;
}
else if (element == 2) {
CMPopTipView *popTip = [[CMPopTipView alloc] initWithTitle:@"Add your calculation to the log" message:@"Tap here"];
popTip.delegate = self;
popTip.backgroundColor = [UIColor clearColor];
popTip.textColor = [UIColor whiteColor];
popTip.has3DStyle = NO;
[popTip presentPointingAtView:self.addtoLogButton inView:self.view animated:YES];
self.addToLogTip = popTip;
}
else if (element == 3) {
CMPopTipView *popTip = [[CMPopTipView alloc] initWithTitle:@"View your calculations" message:@"Tap here"];
popTip.delegate = self;
popTip.backgroundColor = [UIColor clearColor];
popTip.textColor = [UIColor whiteColor];
popTip.has3DStyle = NO;
[popTip presentPointingAtView:self.viewLogButton inView:self.view animated:YES];
self.viewLogTip = popTip;
}

Can i fix it or should I look elsewhere?

Did you have a look at fixing it? Free & open source software is developed by volunteers.

Looks like the width wasn't taking the title into account. I have pushed a fix.

Yeah I had a look through the code, I do now see that the title wasn't taken into account and after I tested a bit more I discovered that if the title is longer than the message its doesn't resize properly.

Thank-you for the fix, its much appreciated.