IOS 綜合技術

來源:互聯網
上載者:User

1.隱藏狀態列    [ [ UIApplication  sharedApplication ] setStatusBarHidden:YES animated:NO ];

2.開啟手機相簿

      首先引入 UIImagePickerControllerDelegate協議

    UIImagePickerController *imgPickerController = [[UIImagePickerControlleralloc]init];

    imgPickerController.delegate =self;

    imgPickerController.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;

    [selfpresentViewController:self.imgPickerControlleranimated:YEScompletion:nil];

3.判斷運行裝置種類並顯示

       NSString *deviceType = [UIDevicecurrentDevice].model; 
  

    NSLog(@"current device type:%@",deviceType);

4.Tabbar圖片上的數字

    self.tabBarItem.badgeValue = [NSStringstringWithFormat:@"%d",9];

5.TableView 去掉cell之間的線

    myTableView.separatorStyle =UITableViewCellSeparatorStyleNone;

6.載入本地檔案PDF

      NSURL *URL = [[NSBundle mainBundle] URLForResource:@"sample" withExtension:@"pdf"];

7.

    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizeralloc]initWithTarget:selfaction:@selector(btnImageView:)];

    

    [self.imageViewaddGestureRecognizer:singleTap];

-(void)btnImageView:(id)sender {

    CABasicAnimation* shake = [CABasicAnimationanimationWithKeyPath:@"transform.rotation.z"];

    

    //設定抖動幅度

    shake.fromValue = [NSNumbernumberWithFloat:-0.1];

    

    shake.toValue = [NSNumbernumberWithFloat:+0.1];

    

    shake.duration =0.1;

    

    shake.autoreverses =YES;//是否重複

    

    shake.repeatCount =4;

    

    [self.imageView.layeraddAnimation:shakeforKey:@"imageView"];

    

   self.imageView.alpha =1.0;

    

    [UIViewanimateWithDuration:2.0delay:2.0options:UIViewAnimationOptionCurveEaseInanimations:nilcompletion:nil];

}

8.

    //UITableView設定背景為透明

    table.backgroundView = nil;

    table.backgroundColor = [UIColor clearColor];

    table.opaque = NO;

9.

將一個UIView顯示在最前面只需要調用其父視圖的 bringSubviewToFront()方法。

將一個UIView層推送到背後只需要調用其父視圖的 sendSubviewToBack()方法。












相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.