-
UILabel换行查看全部
-
NSMutableArray *imageArray=[[NSMutableArray alloc] init]; [imageArray addObject:[UIImage imageNamed:@"logo1"]]; [imageArray addObject:[UIImage imageNamed:@"logo2"]]; UIImageView *imageView=[[UIImageView alloc] init]; imageView.frame=CGRectMake(10, 30, 300, 300); [self.view addSubview:imageView]; imageView.animationImages=imageArray;//设置动画数组 imageView.animationDuration=3;//秒 imageView.animationRepeatCount=0;//不限制 [imageView startAnimating];查看全部
-
UIImageView *imageView=[[UIImageView alloc] initWithImage:image2]; imageView.frame=CGRectMake(10, 30, 300, 400); //内容模式 imageView.contentMode=UIViewContentModeCenter; //UIViewContentModeScaleAspectFill 拉伸 充满最大边 //UIViewContentModeScaleToFill 拉伸 [self.view addSubview:imageView];查看全部
-
//NSString *path=[[NSBundle mainBundle] resourcePath]; //NSString *logo=[NSString stringWithFormat:@"%@/logo.png",path]; //UIImage *image=[[UIImage alloc] initWithContentsOfFile:logo]; UIImage *image2=[UIImage imageNamed:@"logo"];//png可以省略后缀 UIImageView *imageView=[[UIImageView alloc] initWithImage:image2]; imageView.frame=CGRectMake(10, 30, image2.size.width, image2.size.height); [self.view addSubview:imageView];查看全部
-
//利用文本算宽高 CGSize size=[label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(200, 1000) lineBreakMode:NSLineBreakByWordWrapping]; label.frame=CGRectMake(label.frame.origin.x , label.frame.origin.y, size.width, size.height);查看全部
-
层级的互换查看全部
-
//字体大小 //label.font=[UIFont systemFontOfSize:25]; label.font=[UIFont boldSystemFontOfSize:20];//加粗 //label.font=[UIFont italicSystemFontOfSize:25];//倾斜 覆盖原来的 //for(NSString *name in [UIFont familyNames]){ // NSLog(@"%@",name); //} //label.font=[UIFont fontWithName:@"Bodoni 72 Smallcaps" size:25]; //label.shadowColor=[UIColor redColor]; //label.shadowOffset=CGSizeMake(2, 2);//阴影 label.lineBreakMode=NSLineBreakByWordWrapping;//只对英文有效 label.numberOfLines=0;//不限制行数 [self.view addSubview:label];查看全部
-
UILabel *label=[[UILabel alloc] init]; label.frame=CGRectMake(10, 100, 200, 30); label.backgroundColor=[UIColor yellowColor]; label.text=@"My First Label"; //文字布局模式 label.textAlignment=NSTextAlignmentCenter;//居中 //label.textColor=[UIColor clearColor];//透明色 label.textColor=[UIColor colorWithRed:0.1 green:0.2 blue:0.1 alpha:0.5];//sip 工具 label.alpha=0.7; [self.view addSubview:label];查看全部
-
//自适应 UIView *backView=[[UIView alloc] init]; CGSize size=[[UIScreen mainScreen] bounds].size; backView.frame=CGRectMake(size.width/2-25, size.height/2-25, 50, 50); backView.backgroundColor=[UIColor yellowColor]; [self.view addSubview:backView]; //父view 开启子view自适应 //backView.autoresizesSubviews=YES; UIView *topView=[[UIView alloc] init]; topView.frame=CGRectMake(10, 10, 30, 30); topView.backgroundColor=[UIColor whiteColor]; //topView.autoresizingMask=UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin; topView.autoresizingMask=UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; [backView addSubview:topView];查看全部
-
状态栏高20像素查看全部
-
打印屏幕分辨率查看全部
-
各机型分辨率与Retina屏幕使用分辨率。查看全部
-
#if 0 ....endif....中间的代码被注释掉 #endif查看全部
-
UILable的换行如果值设为0或者-1表示不限制行数,能显示多少行显示多少刚。查看全部
-
#if 0 #endif 竟然可以这样查看全部
举报
0/150
提交
取消