iOS--開發小技巧(持續更新)

來源:互聯網
上載者:User

標籤:

 // 模糊效果        UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];        UIVisualEffectView *test = [[UIVisualEffectView alloc] initWithEffect:effect];        test.frame = self.view.bounds;        test.alpha = 0;        [self.view addSubview:test];_mytext = test;        UISlider *slidel = [[UISlider alloc]initWithFrame:CGRectMake(30, 300, 200, 20)];    slidel.backgroundColor = [UIColor purpleColor];    slidel.value = 0;    slidel.maximumValue = 1.0;    slidel.minimumValue = 0.0;    [self.view addSubview:slidel];    slidel.enabled = YES;    [slidel addTarget:self action:@selector(act:) forControlEvents:UIControlEventValueChanged];    - (void)act:(UISlider *)slider{    _mytext.alpha = slider.value;    }

 

// 隱藏手機的狀態列-(BOOL)prefersStatusBarHidden {    return YES;}

 

self.automaticallyAdjustsScrollViewInsets = YES; // 不讓系統幫咱們把scrollView及其子類的視圖向下調整64

 

 //狀態列顯示網路請求提示器    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;        //將window顯示在最外面.    [[[[UIApplication sharedApplication] delegate] window] addSubview:self.view];    

 

//cell高度-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{        NSString *string = self.lrcArr[indexPath.row];        CGRect frame = [string boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width, 10000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:17] forKey:NSFontAttributeName] context:nil];        return frame.size.height;    }
// 在ARC工程中匯入MRC的類  我們選中工程->選中targets中的工程,然後選中Build Phases->在匯入的類後邊加入標記 -  fno-objc-arc// 在MRC工程中匯入ARC的類 路徑與上面一致,在該類後面加上標記 -fobjc-arc

 

iOS--開發小技巧(持續更新)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.