码迷,mamicode.com
首页 > 移动开发 > 详细

iOS--开发小技巧(持续更新)

时间:2016-09-23 18:16:41      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:

 // 模糊效果
        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--开发小技巧(持续更新)

标签:

原文地址:http://www.cnblogs.com/LzwBlog/p/5900924.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!