label自适应高度
摘要:UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)];这个frame是初设的,没关系,后面还会重新设置其size。[label setNumberOfLines:0];NSString *s = @"string......";UIFont *font = [UIFont fontWithName:@"Arial" size:12];CGSize size = CGSizeMake(320,2000);CGSize labelsize = [s sizeWithFont:
阅读全文
posted @
2012-05-31 22:56
chivas
阅读(6642)
推荐(0)
UILable和UITextField的详细讲解
摘要:一、UILabel(1)初始化UILabelC代码 UILabel*scoreLabel=[[UILabelalloc]initWithFrame:CGRectMake((self.bounds.size.width/2),0.0,150.0,43.0)];scoreLabel.textAlignment=UITextAlignmentCenter;scoreLabel.text=@"我是Ad";scoreLabel.textColor=[UIColorwhiteColor];scoreLabel.backgroundColor=[UIColorblackColor];sc
阅读全文
posted @
2012-05-31 22:55
chivas
阅读(2276)
推荐(0)
UILabel的详细使用及特殊效果
摘要://设置阴影[labelsetShadowColor:[UIColorblackColor]];[labelsetShadowOffset:CGSizeMake(-2,3)];//设置是否能与用户进行交互label.userInteractionEnabled=YES;//设置label中的文字是否可变,默认值是YESlabel.enabled=NO;//设置高亮label.highlighted=YES;label.highlightedTextColor=[UIColororangeColor];//设置label的行数label.numberOfLines=2;//设置文字位置label
阅读全文
posted @
2012-05-21 14:32
chivas
阅读(6362)
推荐(0)