-
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;//設(shè)置動畫數(shù)組 imageView.animationDuration=3;//秒 imageView.animationRepeatCount=0;//不限制 [imageView startAnimating];查看全部
-
UIImageView *imageView=[[UIImageView alloc] initWithImage:image2]; imageView.frame=CGRectMake(10, 30, 300, 400); //內(nèi)容模式 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;//不限制行數(shù) [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];查看全部
-
//自適應(yīng) 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自適應(yīng) //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];查看全部
-
狀態(tài)欄高20像素查看全部
-
打印屏幕分辨率查看全部
-
各機型分辨率與Retina屏幕使用分辨率。查看全部
-
#if 0 ....endif....中間的代碼被注釋掉 #endif查看全部
-
UILable的換行如果值設(shè)為0或者-1表示不限制行數(shù),能顯示多少行顯示多少剛。查看全部
-
#if 0 #endif 竟然可以這樣查看全部
舉報
0/150
提交
取消