if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation))
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
[deleteButton setFrame:CGRectMake(984, 7, 30, 30)];
[editButton setFrame:CGRectMake(944, 7, 30, 30)];
}
else
{
if ([[UIScreen mainScreen] bounds].size.height==568)
{
[deleteButton setFrame:CGRectMake(530, 10, 30, 30)];
[editButton setFrame:CGRectMake(490, 10, 30, 30)];
}
else
{
[deleteButton setFrame:CGRectMake(440, 10, 30, 30)];
[editButton setFrame:CGRectMake(400, 10, 30, 30)];
}
}
}
else
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
[deleteButton setFrame:CGRectMake(730, 7, 30, 30)];
[editButton setFrame:CGRectMake(690, 7, 30, 30)];
}
else
{
[deleteButton setFrame:CGRectMake(280, 7, 30, 30)];
[editButton setFrame:CGRectMake(240, 7, 30, 30)];
}
}
[cell.contentView addSubview:editButton];
[cell.contentView addSubview:deleteButton];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
I am developing a universal application. But when I launch the application, it works fine in iOS 7, where, as in the case of iOS 6, custom edit and delete buttons appear for the first time when the screen loads. But then when I change the orientation, it disappears from the screen. I overload the table view when changing Orientations, but still it disappears. Can anybody help me. Amazed at the final point of the project.
source
share