Empty State Method iPhone

#pragma mark - #pragma mark - EMPTY STATE -(void)showEmptyState { //Create Empty State self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; UIImageView *ivEmpty = [[UIImageView alloc] initWithFrame:CGRectMake(60, 100, 200, 200)]; ivEmpty.image = [UIImage imageNamed:@"emptyState.png"]; UILabel *lblEmptyMessage = [[UILabel alloc] initWithFrame:CGRectMake(0, ivEmpty.frame.size.height+50, self.view.frame.size.width, 40)]; lblEmptyMessage.textAlignment = NSTextAlignmentCenter; lblEmptyMessage.textColor = [UIColor darkGrayColor]; lblEmptyMessage.font = [UIFont fontWithName:@"Verdana" size:20]; lblEmptyMessage.text = @"Data not found, try later!"; [self.view addSubview:ivEmpty]; [self.view addSubview:lblEmptyMessage]; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.