iOS7 Side menu status bar color transition. As in the iOS7 Facebook App

前端 未结 3 1048
清酒与你
清酒与你 2021-02-01 10:53

The iOS7 Facebook App has a right side menu that can be shown by swiping right to left or clicking on the upper right button. When this menu is opened the there is a color trans

3条回答
  •  伪装坚强ぢ
    2021-02-01 11:27

    You can use this awesome slide menu library

    https://github.com/arturdev/AMSlideMenu

    In this demo project you can see how to do that by writing 4 lines of code.

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    
        // Setting navigation's bar tint color
        self.navigationController.navigationBar.barTintColor = [UIColor colorWithHex:@"#365491" alpha:1];
    
        // Making view with same color that navigation bar
        UIView *statusBarView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 20)];
        statusBarView.backgroundColor = [UIColor colorWithHex:@"#365491" alpha:1];
    
        // Replace status bar view with created view and do magic :)
        [[self mainSlideMenu] fixStatusBarWithView:statusBarView];
    }
    

提交回复
热议问题