一、present毛玻璃效果
需要设置:menuCtr.modalPresentationStyle = UIModalPresentationOverCurrentContext;
判断系统版本:[UIDevice currentDevice].systemVersion.floatValue >= 8
源码:
SinaMenuViewController *menuCtr = [[SinaMenuViewController alloc]init];
//判断系统版本
if ([UIDevice currentDevice].systemVersion.floatValue >= 8) {
menuCtr.modalPresentationStyle = UIModalPresentationOverCurrentContext;
} else {
menuCtr.modalPresentationStyle = UIModalPresentationCurrentContext;
}
[self.window.rootViewController presentViewController:menuCtr animated:YES completion:nil];
二、方法作为参数
SEL select = isShow?@selector(showAnimation):@selector(hideAnimation);
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.02 target:self selector:@selector(selector) userInfo:nil repeats:YES];
三、button的Title位置
//图片和文字,都有一个edge 上下左右边距
//图片的上左下是依据button的,右是依据label
//label上右下是依据button的,左是依据ImgView的
[btn setTitleEdgeInsets:UIEdgeInsetsMake(80, -81, -10, 0)];//上(依据btn)左(依据img)下右