// cell
之间的间隔
-( void )setFrame:( CGRect )frame{
frame. origin . x = 5;
frame. size . width -= 2 * frame. origin . x ;
frame. size . height -= 1; // 分割线
[ super setFrame :frame];
-( void )setFrame:( CGRect )frame{
frame. origin . x = 5;
frame. size . width -= 2 * frame. origin . x ;
frame. size . height -= 1; // 分割线
[ super setFrame :frame];
}
如果我们发现设置了属性的frame,但是属性的frame并没有变化,那么就应该考虑系统的系统调节frame属性:
- (
void
)awakeFromNib {
// 将自动设置no
self
.
autoresizingMask
=
UIViewAutoresizingNone
;
}
显示图片高度等于显示图片宽度乘以图片高度除以图片宽度
CGFloat
pictureW = maxSize.
width
;
CGFloat
pictureH = pictureW *
self
.
height
/
self
.
width
;
#pragma mark -
手势的响应事件
-( void )tapGestureAction:( UITapGestureRecognizer *)tap{
// 初始化控制器
EssenceImageViewController *imageVC = [[ EssenceImageViewController alloc ] init ];
// view 没有 present 方法,所以使用 UIApplication
[[ UIApplication sharedApplication ]. keyWindow . rootViewController presentViewController :imageVC animated : YES completion : nil ];
-( void )tapGestureAction:( UITapGestureRecognizer *)tap{
// 初始化控制器
EssenceImageViewController *imageVC = [[ EssenceImageViewController alloc ] init ];
// view 没有 present 方法,所以使用 UIApplication
[[ UIApplication sharedApplication ]. keyWindow . rootViewController presentViewController :imageVC animated : YES completion : nil ];
}