1.UILabel
1.text 设置label显示的文本
2.font 字体大小 系统自带样式 / 粗体样式 / 斜体样式
3.textColor 字体颜色
4.backgroundColor 背景颜色
5.lineBreakMode 内容缩进模式
6.numOfLines 0 :自动换行
2.UIImageView
1.frame
初始化的时候直接传一个图片,按照图片的大小设置UIImageView的尺寸
2.结构体.一定要进行强转
CGRect frame = {CGPoint,CGSize} = {{x,y},{width,height}}
3.内容模式
方式一:
UIViewContentModeScaleToFill,//默认情况下
保持与UIImageView的宽高一致
//保持图片的宽高比进行缩放,刚好图片显示完全
UIViewContentModeScaleAspectFit,
//保持图片的宽高比进行缩放,宽或者高度达到吻合就居中显示
UIViewContentModeScaleAspectFill,
UIViewContentModeRedraw, //牵扯到了核心动画 不用管
方式二:不进行任何拉伸,显示在哪个位置
UIViewContentModeCenter,
UIViewContentModeTop,
UIViewContentModeBottom,
UIViewContentModeLeft,
UIViewContentModeRight,
UIViewContentModeTopLeft,
UIViewContentModeTopRight,
UIViewContentModeBottomLeft,
UIViewContentModeBottomRight,
command +] 代码往后边缩进
4.帧动画 一张一张图片的切换
5.mainBundle :所有资源文件存放的地方:使用[NSBundle mainBundle]获取
6.缓存 :只要缓存下来的东西都会直接保存到内存
优点: 可以直接访问,不需要加载
缺点: 消耗设备内存,移动端的内存都是特别紧张
7.imageWithContentOfFile:临时的缓存
8.剪掉超出imageView的尺寸 clipsToBounds