小紅點
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(25, 6, 14, 14)];
label.text = @"1";
label.font = [UIFont systemFontOfSize:10];
label.textAlignment = NSTextAlignmentCenter;
label.backgroundColor = UIColorHex(#DA0851);
label.textColor = [UIColor whiteColor];
label.layer.masksToBounds = YES;
label.layer.cornerRadius = 7.f;
label.userInteractionEnabled = YES;
二、遮罩層
UIView *coverView = [[UIView alloc]initWithFrame:self.view.bounds];
coverView.alpha = 0.5;
coverView.backgroundColor=[UIColor blackColor];
[self.view addSubview:coverView];
self.coverView = coverView;
當(dāng)透明度為0-0.01時,可以把這個遮罩層當(dāng)不存在一樣,完全可以擊穿遮罩層。而安卓因為焦點的問題點擊不到遮罩層下面也是和iOS有區(qū)別。