- bundle创建与使用,新建一个文件夹,把后缀名称改为bundle即可
NSBundle * bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"TestBundle" ofType:@"bundle"]];
NSString * strPath = [bundle pathForResource:@"huaji" ofType:@"jpg"];
UIImage *storyMenuItemImage = [UIImage imageWithContentsOfFile:strPath];
UIImageView * iv = [[UIImageView alloc]initWithFrame:self.view.bounds];
iv.image = storyMenuItemImage;
[self.view addSubview:iv];
2.//设置字体的阴影
label.shadowColor = [UIColor blackColor];
label.shadowOffset = CGSizeMake(1.414, 1.414);
label.text = @"hello";
3.打印全部字体,设置字体
;
4.文本显示不下的时候,处理多余文字的办法
/*
NSLineBreakByWordWrapping,//按单词截断句尾,舍弃多余部分
NSLineBreakByCharWrapping,//按字符截断句尾,舍弃多余部分
NSLineBreakByClipping,//简单裁剪
NSLineBreakByTruncatingHead,//在句首显示省略号
NSLineBreakByTruncatingTail,//在句尾显示省略号
NSLineBreakByTruncatingMiddle//在句中显示省略号
*/
label.lineBreakMode = NSLineBreakByWordWrapping;