小编Dis*_*yOV的帖子

多个UIAlertView; 每个都有自己的按钮和动作

我在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)

谢谢你的帮助!

xcode button uialertview ibaction

16
推荐指数
2
解决办法
2万
查看次数

从页面顶部滚动100px后显示div

我找到了这个,但是它在页面底部之前完成了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)

html javascript jquery

16
推荐指数
2
解决办法
5万
查看次数

4.5安装后,启动板中的两个Xcode应用程序图标

通过App Store更新Xcode后,我的启动板中现在有2个Xcode应用程序.我可以通过按住鼠标按钮并单击出现的x来删除新的按钮,但仅限于新的按钮.

macos xcode

9
推荐指数
2
解决办法
3913
查看次数

第二次发布后制作UIAlertView节目

如果那是不可能的,那么我应该怎么做呢,比如3分钟的app使用?这将用于Rate Us警报但我宁愿用户有一些时间来实际使用该应用程序,然后才要求他们评分.

xcode uialertview ios

2
推荐指数
1
解决办法
1231
查看次数

标签 统计

xcode ×3

uialertview ×2

button ×1

html ×1

ibaction ×1

ios ×1

javascript ×1

jquery ×1

macos ×1