Skip to content

Instantly share code, notes, and snippets.

@khanhduytran0
Created February 9, 2024 01:52
Show Gist options
  • Save khanhduytran0/f4b133c715c96a10188012dd953a5f7d to your computer and use it in GitHub Desktop.
Save khanhduytran0/f4b133c715c96a10188012dd953a5f7d to your computer and use it in GitHub Desktop.
Make Dynamic Island transparent with custom background color
#import <UIKit/UIKit.h>
// Make Dynamic Island transparent
@interface _SBGainMapView : UIView
@end
%hook _SBGainMapView
- (void)setFrame:(CGRect)frame {
%orig(frame);
self.hidden = YES;
}
%end
@interface SBSystemApertureViewController : UIViewController
@end
%hook SBSystemApertureViewController
- (void)viewWillAppear:(BOOL)animated {
%orig;
// You can set background color and transparency here
MSHookIvar<UIView *>(self, "_containerBackgroundParent").subviews[1].subviews[0].backgroundColor = [UIColor colorWithWhite:0 alpha:0.6];
}
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment