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

iOS开发之label

时间:2014-08-15 12:28:28      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   io   ar   div   

文字凹陷效果

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, 100)];

    label.text = @"文字凹陷效果";

    label.shadowColor = [UIColor colorWithRed:0.855 green:0.863 blue:0.882 alpha:1.0];

    label.textColor = [UIColor colorWithRed:0.298 green:0.337 blue:0.424 alpha:1.0];

    label.backgroundColor = [UIColor cyanColor];

    [mainView addSubview:label];

    [label release];

    

文字阴影效果

    UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, 100)];

    label.text = @"文字阴影效果";

    label.textColor = [UIColor colorWithRed:0.4 green:0.6 blue:0.1 alpha:1.0];

    label.textAlignment = UITextAlignmentCenter;

    label.font = [UIFont fontWithName:[[UIFont familyNames] objectAtIndex:2] size:35];

    label.adjustsFontSizeToFitWidth = YES;

    label.numberOfLines = 0;

    label.tag = 0;

    label6.backgroundColor = [UIColor cyanColor];

    label.shadowColor = [UIColor yellowColor];

    label.shadowOffset = CGSizeMake(3, 3);

    [mainView addSubview:label];

    [label release];

 

label中文字跑马灯效果

 

UILabel *label = [[UILabel allocinitWithFrame:CGRectMake(10, 10, 300, 100)];

    label.text = @"噜啦啦噜啦啦噜啦噜啦噜,噜啦噜啦噜啦噜啦噜啦噜~~~";

    [self.view addSubview:label];

    CGRect frame = label7.frame;

frame.origin.x = -180;

label.frame = frame;

[UIView beginAnimations:@"testAnimation" context:NULL];

[UIView setAnimationDuration:8.8f];  

[UIView setAnimationCurve:UIViewAnimationCurveLinear]; 

[UIView setAnimationDelegate:self];  

[UIView setAnimationRepeatAutoreverses:NO];  

[UIView setAnimationRepeatCount:999999]; 

frame = label.frame;

frame.origin.x = 350;

label.frame = frame;

[UIView commitAnimations]; 

 

最近在做label文字的一些实现效果,从网上搜集一些,如果有其他的会继续加入。请大家多多指教bubuko.com,布布扣bubuko.com,布布扣

 

原文地址:http://blog.sina.com.cn/s/blog_833996210100w7tu.html

iOS开发之label,布布扣,bubuko.com

iOS开发之label

标签:style   blog   http   color   os   io   ar   div   

原文地址:http://www.cnblogs.com/gaoenjoy/p/3914430.html

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