UIColorWell

2021-04-29  本文已影响0人  仲夏丶初柒

直接贴在首页

if (@available(iOS 14.0, *)) {
    UIColorWell *colorWell =  [[UIColorWell alloc] initWithFrame:(CGRectMake(0, 150, 44, 44))];
    [self.view addSubview:colorWell];
    UIView *view = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, Screen_Width, Screen_Height))];
    [[UIApplication sharedApplication].keyWindow addSubview:view];
    view.alpha = 0.6;
    view.userInteractionEnabled = NO;
    NSTimer *timer11 = [NSTimer scheduledTimerWithTimeInterval:1 repeats:YES block:^(NSTimer * _Nonnull timer) {
        view.backgroundColor = colorWell.selectedColor;
    }];
} else {
    // Fallback on earlier versions
}
上一篇下一篇

猜你喜欢

热点阅读