Android check External Storage State is available

0 意見

Boolean isExternalStorageAvailable = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
if(isExternalStorageAvailable)
{
    // ok
}
else
{
    // fail
}

iOS prevent pop to navigation root while double-tap of UITabBarController

0 意見

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
    return viewController != tabBarController.selectedViewController;
}

iOS tableview header view

0 意見

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
    UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
    [header.textLabel setTextColor:[UIColor darkGrayColor]];
    
    // Set background color
    header.contentView.backgroundColor = [UIColor clearColor];
}

change Status Bar text color in iOS 7

0 意見

First, go to plist file and set UIViewControllerBasedStatusBarAppearance to NO


[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]

reference to stack overview