我在Xcode 4.3中创建一个视图,我不确定如何指定多个UIAlertView,它们有自己的按钮和单独的动作.目前,我的警报有自己的按钮,但操作相同.以下是我的代码.
-(IBAction)altdev {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"titleGoesHere"
message:@"messageGoesHere"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Continue", nil];
[alert show];
}
-(IBAction)donate {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"titleGoesHere"
message:@"messageGoesHere"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Continue", nil];
[alert show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.examplesite1.com"]];
}
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"examplesite2.com"]];
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助!
我找到了这个,但是它在页面底部之前完成了100px.我需要从页面顶部100px.我知道如何实现它,我已经做了其他jquery动画,而不是在这个中需要的东西.
$(window).scroll(function(){
if($(window).scrollTop() + 100 > $(document).height() - $(window).height() ){
alert("at bottom");
}
});
Run Code Online (Sandbox Code Playgroud)
而且,我需要知道如何反转这一点,以便当用户在100px之前向上滚动时div消失.
这将用于导航栏.
Edit2>这也有效:
$(window).scroll(function(){
if($(window).scrollTop() > 100){
$("#div").fadeIn("slow");
}
});
$(window).scroll(function(){
if($(window).scrollTop() < 100){
$("#div").fadeOut("fast");
}
});
Run Code Online (Sandbox Code Playgroud) 通过App Store更新Xcode后,我的启动板中现在有2个Xcode应用程序.我可以通过按住鼠标按钮并单击出现的x来删除新的按钮,但仅限于新的按钮.
如果那是不可能的,那么我应该怎么做呢,比如3分钟的app使用?这将用于Rate Us警报但我宁愿用户有一些时间来实际使用该应用程序,然后才要求他们评分.