【发布时间】:2019-03-09 03:31:56
【问题描述】:
我想在 SideMenu 上将徽标居中,这是目前的代码:
UIImageView *logo =[[UIImageView alloc] init];
logo.image=[UIImage imageNamed:@"menulogo"];
logo.contentMode = UIViewContentModeScaleToFill;
logo.layer.cornerRadius = cornerRadius;
logo.layer.masksToBounds = YES;
logo.frame = container.bounds;
[container addSubview:logo];
[headerView addSubview:container];
【问题讨论】:
-
您已将徽标的框架设置为与容器的框架相同,因此它无法居中。
标签: ios objective-c swift xcode xcode8