亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

iOS微信分享后關閉發(fā)送成功提示并返回應用

 更新時間:2016年09月14日 11:56:18   投稿:lijiao  
這篇文章主要為大家詳細介紹了iOS微信分享后關閉發(fā)送成功提示并返回應用的相關資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下

iOS 分享到微信之后返回應用關閉發(fā)送成功的提示,并自定義提示,具體內容如下

1.關閉發(fā)送成功的提示 

只要在分享的時候調用一下代碼即可:

復制代碼 代碼如下:
 [UMSocialConfig setFinishToastIsHidden:YES  position:UMSocialiToastPositionCenter]; 

2.自定義提示 

//如果點擊返回app會調用這個方法
 - (void)didFinishGetUMSocialDataInViewController:(UMSocialResponseEntity *)response {
   //返回200說明分享成功 
  if (response.responseCode == 200) { 
      //分享成功之后彈出這個提示語 
 
      //自己添加遮罩層,并添加點擊手勢,方便回收提示 
      self.mask2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, kScreen_Height)]; 
      self.mask2.backgroundColor = [[UIColor colorWithHexColorString:@"000000"] colorWithAlphaComponent:0.5]; 
      UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)]; 
      [self.mask2 addGestureRecognizer:tap]; 
      [self.view.window addSubview:self.mask2];
     //遮罩層上放提示框      
      self.showView = [[UIView alloc] init]; 
      self.showView.frame = CGRectMake(32, kScreen_Height/2.0-((kScreen_Width-64)/254.0*150.0+44)/2.0-20, kScreen_Width-64, 0);
      self.showView.backgroundColor = [UIColor whiteColor]; 
      self.showView.layer.cornerRadius = 20; 
      [self.mask2 addSubview:_showView];
 
      
 
      UILabel *titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, _showView.width, 31)]; 
      titleLab.text = @"分享成功"; 
      titleLab.textAlignment = NSTextAlignmentCenter; 
      titleLab.backgroundColor = [UIColor redColor]; 
      titleLab.textColor = [UIColor whiteColor]; 
      titleLab.font = [UIFont systemFontOfSize:15]; 
     //使用貝塞爾曲線,繪制一個上面兩個是圓角的矩形 
      UIBezierPath *titlePath = [UIBezierPath bezierPathWithRoundedRect:titleLab.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight cornerRadii:CGSizeMake(20, 20)]; 
      CAShapeLayer *titleLayer = [CAShapeLayer layer]; 
      titleLayer.frame = titleLab.bounds; 
      titleLayer.path = titlePath.CGPath; 
      titleLab.layer.mask = titleLayer; 
      [_showView addSubview:titleLab]; 
 
      UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(16, 31+16, _showView.width-32, 15)]; 
      lab.textAlignment = NSTextAlignmentLeft;
       lab.text = @"大家都在看"; 
      lab.textColor = [UIColor colorWithHexColorString:@"000000"]; 
      lab.font = [UIFont systemFontOfSize:15]; 
      [_showView addSubview:lab];
 
      
 
      NSMutableArray *arr = [[NSMutableArray alloc] initWithObjects:@"",@"" nil]; 
      int y = 31+16+15+16; 
      for (int i = 0; i<arr.count; i++) {
 
        UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom]; 
        CGSize size = [self getStringSize:arr[i] andFont:13 andWidth:self.showView.width-32]; 
        button1.tag = 600+i; 
        button1.frame = CGRectMake(16, y, _showView.width-32, size.height); 
        [button1 setTitle:arr[i] forState:UIControlStateNormal]; 
        button1.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; 
        [button1 setTitleColor:[UIColor colorWithHexColorString:@"0096ff"] forState:UIControlStateNormal]; 
        button1.titleLabel.font = [UIFont systemFontOfSize:13]; 
        [button1 addTarget:self action:@selector(button1Click:) forControlEvents:UIControlEventTouchUpInside]; 
        button1.titleLabel.numberOfLines = 0; 
        [_showView addSubview:button1]; 
        y+=size.height+16;
         if (i+1!=arr.count) { 
          UIView *line = [[UIView alloc] initWithFrame:CGRectMake(16, y, self.showView.width-32, 0.5)]; 
          line.backgroundColor = [UIColor colorWithHexColorString:@"f0f0f0"]; 
          [_showView addSubview:line]; 
          y+=0.5+16;
 
        }
 
        
 
      }
 
      self.showView.frame = CGRectMake(32, kScreen_Height/2.0-((kScreen_Width-64)/254.0*150.0+44)/2.0-20, kScreen_Width-64, y+16); 
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 
    }]; 
  }else{ 
    [MBProgressHUD showError:@"分享失敗"]; 
  }
 
}
 
 
 
//獲取字符串的長度 
-(CGSize)getStringSize:(NSString*)needString andFont:(CGFloat)font andWidth:(NSInteger)width
 
{ 
  CGSize size = CGSizeZero; 
  size = [needString boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:font]} context:nil].size; 
  return size; 
} 
//若點擊在某個區(qū)域之內不觸發(fā),否則觸發(fā) 
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { 
  if ([touch.view isDescendantOfView:self.showView]) { 
    return NO; 
  }else { 
    return YES 
    ; 
  } 
} 
- (void)tap:(UITapGestureRecognizer *)sender {
 
  [self.mask2 removeFromSuperview];
 
} 
- (void)button1Click:(UIButton *)sender { 
  [self.mask2 removeFromSuperview]; 
  switch (sender.tag) { 
    case 600: 
    {
     }
       break;
     case 601:
 
    { 
    } 
      break; 
    default: 
      break; 
  }
 
}

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

  • iOS Touch ID指紋識別技術簡介

    iOS Touch ID指紋識別技術簡介

    這篇文章主要為大家詳細介紹了iOS Touch ID指紋識別技術,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2019-04-04
  • iOS 簡約日歷控件EBCalendarView的實現(xiàn)代碼

    iOS 簡約日歷控件EBCalendarView的實現(xiàn)代碼

    本篇文章主要介紹了iOS 簡約日歷控件EBCalendarView的實現(xiàn)代碼,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-05-05
  • 談談iOS開發(fā)之JSON格式數(shù)據(jù)的生成與解析

    談談iOS開發(fā)之JSON格式數(shù)據(jù)的生成與解析

    JSON格式取代了xml給網絡傳輸帶來了很大的便利,本篇文章主要介紹了iOS開發(fā):對象直接轉化成JSON詳解,具有一定的參考價值,有興趣的可以了解一下。
    2017-01-01
  • iOS中將個別頁面強制橫屏其他頁面豎屏

    iOS中將個別頁面強制橫屏其他頁面豎屏

    這篇文章主要介紹了iOS中將個別頁面強制橫屏其他頁面豎屏的實現(xiàn)思路,需要的朋友參考下吧
    2016-12-12
  • 詳解Xcode 9 設置 iOS無線真機調試

    詳解Xcode 9 設置 iOS無線真機調試

    本篇文章主要介紹了詳解Xcode 9 設置 iOS無線真機調試,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-12-12
  • Xcode8打印一堆log問題的快速解決方法

    Xcode8打印一堆log問題的快速解決方法

    剛裝的xcode8,不知道從哪來的一堆log,很奇怪。怎么解決此問題呢?下面小編給大家分享本教程幫助大家了解Xcode8打印一堆log問題的快速解決方法,感興趣的朋友跟著小編一起學習吧
    2016-10-10
  • IOS添加自定義字體實例詳解

    IOS添加自定義字體實例詳解

    這篇文章主要介紹了IOS添加自定義字體實例詳解的相關資料,需要的朋友可以參考下
    2017-04-04
  • iOS將視頻錄像切成一張張縮略圖

    iOS將視頻錄像切成一張張縮略圖

    這篇文章主要為大家詳細介紹了iOS將視頻錄像切成一張張縮略圖的相關代碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-11-11
  • iOS兩丫技術之UILabel性能不夠的解決方法

    iOS兩丫技術之UILabel性能不夠的解決方法

    這篇文章主要介紹了iOS中控件UILabel性能不夠而自定義UILabel的過程,UILable是iPhone界面最基本的控件,主要用來顯示文本信息,下面通過本文我們來了解一下
    2022-08-08
  • iOS實現(xiàn)多個垂直滑動條并列視圖

    iOS實現(xiàn)多個垂直滑動條并列視圖

    這篇文章主要為大家詳細介紹了iOS實現(xiàn)多個垂直滑動條并列視圖,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-03-03

最新評論