Reputation:
UIActionSheet' was displaying properly in my one of the application until iOS 7 release. But now when I open UIActionSheet in iOS 7, it shows black line` on top corner of action sheet. As you can see in below image
After spending ample amount of time to find its reason, Finally I found that if we display UIActionSheet title
(set title property with some text) then those black line removed by iOS 7. like image
But As per requirement I don't want to display UIActionSheet title. So Is there any other approach to remove those black lines in corner? Or its an iOS 7 bug?
- (IBAction) showActionsheetWithoutTitle:(id)sender {
UIActionSheet *actionsheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Button1", @"Button2",@"Button3", nil];
[actionsheet showInView:self.view];}
Upvotes: 0
Views: 578
Reputation: 620
Replace @"" with nil for initWithTitle, as it takes a small gap between the title and other buttons:
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:@"Button1", @"Button2",@"Button3", nil];
Upvotes: 4