ios开发 UI高级 间距设置

// cell 之间的间隔
-(
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 ];
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值