(More info.) |
No edit summary |
||
Line 4: | Line 4: | ||
_UIBackdropView uses the settings for its setup. (superclass _UIBackdropViewSettings) Here's all settings class available in iOS 7 | _UIBackdropView uses the settings for its setup. (superclass _UIBackdropViewSettings) Here's all settings class available in iOS 7 | ||
{| class="wikitable" | {| class="wikitable sortable" | ||
|- | |- | ||
! Class name | ! Class name | ||
Line 19: | Line 19: | ||
|- | |- | ||
| _UIBackdropViewSettingsLight | | _UIBackdropViewSettingsLight | ||
| 0, 1000, 1003 | | 2020, 0, 1000, 1003, 10090, 10100 | ||
| | | | ||
|- | |- | ||
| _UIBackdropViewSettingsDark | | _UIBackdropViewSettingsDark | ||
| 1, 1001, 1100 | | 2030, 1, 1001, 1100, 11050, 11060 | ||
| iOS 7 Notification Center (?) | | iOS 7 Notification Center (?) | ||
|- | |- | ||
Line 85: | Line 85: | ||
| _UIBackdropViewSettingsPasscodePaddle | | _UIBackdropViewSettingsPasscodePaddle | ||
| 3900 | | 3900 | ||
| | | iOS 7.1+ | ||
|- | |- | ||
| _UIBackdropViewSettingsLightKeyboard | | _UIBackdropViewSettingsLightKeyboard | ||
| 3901 | | 3901 | ||
| | | iOS 7.1+ | ||
|- | |- | ||
|} | |} | ||
Line 107: | Line 107: | ||
</source> | </source> | ||
== Creating | == Creating Sample == | ||
<source lang="objc"> | <source lang="objc"> | ||
Line 128: | Line 128: | ||
</source> | </source> | ||
== Blurring == | == Blurring Sample == | ||
There are only two blur qualities available. | There are only two blur qualities available. | ||
Line 145: | Line 145: | ||
</source> | </source> | ||
== Tinting == | == Tinting Sample == | ||
<source lang="objc"> | <source lang="objc"> | ||
Revision as of 12:32, 30 May 2014
_UIBackdropView is a private class in UIKit.framework (iOS 7.0+), a subclass of UIView, which is used for the popular blur effects.
It uses a CABackdropLayer with a gaussianBlur CAFilter.[1]
_UIBackdropView uses the settings for its setup. (superclass _UIBackdropViewSettings) Here's all settings class available in iOS 7
Class name | Style number(s) | Comments/Used by |
---|---|---|
_UIBackdropViewSettingsCombiner | -3 | |
_UIBackdropViewSettingsNone | -2 | |
_UIBackdropViewSettingsLight | 2020, 0, 1000, 1003, 10090, 10100 | |
_UIBackdropViewSettingsDark | 2030, 1, 1001, 1100, 11050, 11060 | iOS 7 Notification Center (?) |
_UIBackdropViewSettingsBlur | 2 | Common blurring |
_UIBackdropViewSettingsColorSample | 2000 | |
_UIBackdropViewSettingsUltraLight | 2010 | Some alert views in Settings app & many white UIs |
_UIBackdropViewSettingsLightLow | 2029 | |
_UIBackdropViewSettingsDarkWithZoom | 2031 | |
_UIBackdropViewSettingsDarkLow | 2039 | |
_UIBackdropViewSettingsColored | 2040 | rgba(0.0196078,0.0196078,0.0196078,1) |
10091 | rgba(0.160784,1,0.301961,1) | |
10092 | rgba(1,0.0980392,0.0470588,1) | |
10120 | rgba(0.0313725,0.262745,0.560784,1) | |
_UIBackdropViewSettingsUltraDark | 2050, 11070 | |
_UIBackdropViewSettingsAdaptiveLight | 2060 | iOS 7 Control Center |
_UIBackdropViewSettingsSemiLight | 2070 | |
_UIBackdropViewSettingsFlatSemiLight | 2071 | |
_UIBackdropViewSettingsUltraColored | 2080 | |
_UIBackdropViewSettingsPasscodePaddle | 3900 | iOS 7.1+ |
_UIBackdropViewSettingsLightKeyboard | 3901 | iOS 7.1+ |
There are many ways to create the settings object
_UIBackdropViewSettings *settings = (_UIBackdropViewSettings *)[[[_UIBackdropViewSettingsSemiLight alloc] init] autorelease];
_UIBackdropViewSettings *settings = [_UIBackdropViewSettings settingsForStyle:2070];
_UIBackdropViewSettings *settings = [_UIBackdropViewSettings settingsForPrivateStyle:2070];
_UIBackdropViewSettings *settings = [[[_UIBackdropViewSettings alloc] initWithDefaultsValue] autorelease];
Creating Sample
// Creating blur view using settings object
_UIBackdropViewSettings *settings = [_UIBackdropViewSettings settingsForStyle:2060];
// initialization of the blur view
_UIBackdropView *blurView = [[_UIBackdropView alloc] initWithFrame:CGRectZero
autosizesToFitSuperview:YES settings:settings];
// another way for initialization
_UIBackdropView *blurView = [[_UIBackdropView alloc] initWithSettings:settings];
// or without settings object implementation
_UIBackdropView *blurView = [[_UIBackdropView alloc] initWithStyle:2060];
[someView addSubview:backView];
[blurView release];
Blurring Sample
There are only two blur qualities available.
- low
- default (Assumed to be "medium")
[blurView setBlurRadiusSetOnce:NO];
[blurView setBlurRadius:10.0];
[blurView setBlurHardEdges:3];
[blurView setBlurWithHardEdges:YES];
[blurView setBlurQuality:@"low"];
Tinting Sample
[blurView setRequiresColorStatistics:YES];
[blurView setUsesColorTintView:YES];
UIColor *color = [UIColor cyanColor];
[blurView setColorTint:color]; // or you may use - (void)transitionToColor:(UIColor *)color;
[blurView setColorTintAlpha:0.8];
[blurView setColorTintMaskAlpha:0.7];
Applying blur settings/style
There are several ways for doing this by methods.
Signature | - (void)transitionIncrementallyToPrivateStyle:(int)style weighting:(float)weight; |
---|---|
Available in | 7.0 – |
Signature | - (void)transitionIncrementallyToStyle:(int)style weighting:(float)weight; |
---|---|
Available in | 7.0 – |
Signature | - (void)transitionToSettings:(_UIBackdropViewSettings *)settings; |
---|---|
Available in | 7.0 – |
Signature | - (void)transitionToPrivateStyle:(int)style; |
---|---|
Available in | 7.0 – |
Signature | - (void)transitionToStyle:(int)style; |
---|---|
Available in | 7.0 – |
For example
_UIBackdropViewSettings *newSettings = [_UIBackdropViewSettings settingsForPrivateStyle:0];
// Whatever configuration for the settings
[blurView setInputSettings:newSettings];
Getting/Parsing all _UIBackdropView objects at runtime
NSArray *blurViews = [_UIBackdropView allBackdropViews];
for (_UIBackdropView *view in blurViews) {
NSLog(@"This _UIBackdropView style is: %d", view.style);
// do any _UIBackdropView configuration here
}
References