Comments (4)
when i add a time delay, it works fine.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[alertView dismiss];
});
I am not find the real reason . but hope you fix the bug!
from cxalertview.
Thanks, I will fix it ASAP.
from cxalertview.
Were you able to fix the bug?? I'm having a lot of problems with this... The dispatch_after method seemed to work, but now I'm getting double alertviews to show for a second before the first one disappears...
from cxalertview.
@jlubeck I found a workaround for this bug.
I instantiated my alert view inside a dispatch_after method. See below:
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSString *showmessage = [[NSString alloc] init];
showmessage = [_defaults objectForKey:@"activatedFenceMessage"];
if (![showmessage isEqualToString:@"1"]) {
UIView *customAlertView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 260, 199)];
UIImageView *ivFunc = [[UIImageView alloc] initWithFrame:CGRectMake(57, 8, 146, 88)];
[ivFunc setImage:[UIImage imageNamed:@"apresentacao_cerca_criada"]];
[ivFunc setContentMode:UIViewContentModeScaleAspectFit];
[customAlertView addSubview:ivFunc];
UILabel *mensagem = [[UILabel alloc] initWithFrame:CGRectMake(8, 108, 250, 53)];
[mensagem setFont:[UIFont systemFontOfSize:11]];
[mensagem setLineBreakMode:NSLineBreakByWordWrapping];
[mensagem setNumberOfLines:6];
[mensagem setTextAlignment:NSTextAlignmentCenter];
mensagem.text = activatedFence;
[customAlertView addSubview:mensagem];
CXAlertView *alertViewMe = [[CXAlertView alloc] initWithTitle:fenceTitle contentView:customAlertView cancelButtonTitle:nil];
// This is a demo for multiple line of title.
[alertViewMe addButtonWithTitle:multiLineMessageAcceptedText
type:CXAlertViewButtonTypeDefault
handler:^(CXAlertView *alertView2, CXAlertButtonItem *button) {
[_defaults setObject:@"0" forKey:@"activatedFenceMessage"];
[alertView2 dismiss];
}];
[alertViewMe addButtonWithTitle:multiLineMessageCancelText
type:CXAlertViewButtonTypeCancel
handler:^(CXAlertView *alertView2, CXAlertButtonItem *button) {
[_defaults setObject:@"1" forKey:@"activatedFenceMessage"];
[alertView2 dismiss];
}];
[alertViewMe show];
}
});
from cxalertview.
Related Issues (20)
- possible to show images? HOT 1
- AlertView is not moving up when keyboard comes up HOT 5
- UIAlertView on ios7 seems to not bold the cancel button HOT 2
- "LFGlassView.h" file not found HOT 2
- alert another cxalertview in button handler will make self.view unaccessable after dismiss this two alertview.
- New version? HOT 4
- [CXAlertView dismiss] bug HOT 2
- Frost background issue HOT 1
- How to show images in Buttons ? HOT 1
- IOS 7 deprecated warning
- option to hide button container
- orientation bug iOS 8 HOT 1
- Background Scrim is Too Far Right
- CXAlertBackgroundWindow.h HOT 10
- Update release to 1.1.0 HOT 1
- Message isn't customizable, e.g. font, color. HOT 4
- When string length is too long, view does not grow HOT 1
- Issue getting only in iOS 9 above versions HOT 1
- CXAlertViewController force showing status bar HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cxalertview.