---
# System prepended metadata

title: 『Flutter』 啟動載入畫面黑畫面
tags: [Flutter]

---

# 『Flutter』 啟動載入畫面黑畫面
###### tags: `Flutter`
Android


修改
android/app/src/main/res/drawable/launch_background.xml

AndroidManifest.xml 增加
```=
 <meta-data
     android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
     android:value="true" />
 <meta-data
     android:name="io.flutter.embedding.android.SplashScreenDrawable"
     android:resource="@drawable/launch_background" />
``` 

---

ios
```=
#pragma mark - life cycle
- (instancetype)init {
    self = [super init];
    if (self) {
        UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        view.backgroundColor = [UIColor whiteColor];
        self.splashScreenView = view;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    if (self.navigationController) {
        [self.navigationController setNavigationBarHidden:YES animated:YES];
    }
}

@end
```