iOS 设置导航栏透明后 push 界面 界面下移64高度
解决方法:
self.extendedLayoutIncludesOpaqueBars = YES;
设置有导航栏自动添加高度为64 为No
self.automaticallyAdjustsScrollViewInsets = NO;
iOS开发_自定义UISwitch 改变UISwitch大小
// OC版
- (void)awakeFromNib {
[superawakeFromNib];
self.transform=CGAffineTransformMakeScale(0.5,0.5);
self.layer.anchorPoint=CGPointMake(0,0.5);
}
// Swift
classSwitchButton:UISwitch {
overridefuncawakeFromNib() {
transform=CGAffineTransformMakeScale(0.5,0.5)
layer.anchorPoint=CGPoint(x:0, y:0.3)
}}