-3

So strange since some of the photos not displayed in iOS 7 but displayed well in iOS 6. I've both normal & @2x & -568@2x. It happens with IBOutlet UIImageView and also when I subclass UIAlertView.

For example:

EDIT:

alert = [[UIAlertTrapAlarm alloc] initWithCameraType:camType andFrame:[UIScreen mainScreen].bounds];

    [[NSNotificationCenter defaultCenter] postNotificationName:CreateDistance object:nil userInfo:dictionary];
     [alert addButtonWithTitle:NSLocalizedString(@"not_exists", nil)];
     [alert addButtonWithTitle:NSLocalizedString(@"exists", nil)];
    [alert show];
    [alert changeMessageBox:distance description:trapDesc type:trapTypeString];
    [alert showHideExistsNotExistsButtons:camType];
    [alert showHideButtons];
//    alert.imageViewBackground.image = [UIImage imageNamed:@"allert1"];
    [alert.imageViewBackground setImage:[UIImage imageNamed:@"allert1.png"]];
    [alert setNeedsDisplay];
    [alert.screenView setNeedsDisplay];

I forgot to mention all subviews in my subclass UIAlertView not showing.

Idan Moshe
  • 1,675
  • 4
  • 28
  • 65

2 Answers2

2

Well you can check your Interface builder if you use Xcode 5 , there is option for viewing your Xib as 7.0 to later or 6.0 to earlier like this. See if your UIImageView is at correct place when you see it as iOS 7.0 to later. If you can't see your UIImageView then my answer might help.

I have had this problem few days ago , when I switch between iOS 6 to iOS 7 then some views became invisible and Interface builder showed garbage values at attribute inspector , like position (-680 , 675 ) , W/H (0,0) something like this. I solved this problem by unchecking AutoResizing masks of right and bottom. That solved my issue.

You can try if your problem is something similar. Because without more detail information about your codes and others , it's hard to give you a exact solution.

ayon
  • 2,180
  • 2
  • 17
  • 32
1

From that one line of code my guess is that your setting the background image in code while you set the foreground image in Interface Builder.

Try using

alert.image = [UIImage imageNamed:@"allert1"];
Jörg Kirchhof
  • 1,530
  • 1
  • 9
  • 19
  • Switching code to iOS 6 all images works perfect. The name is correct. I changed to 'setImage' and added '.png' and still nothing. I deal with it when I subclass UIAlertView, thats my main problem right now. – Idan Moshe Oct 06 '13 at 08:49
  • 2
    Really? I always thought you need to provide an extension.... But anyways: Now I (guess I) know what your problem is: In iOS 7 you're not allowed to change the look of `UIAlertView` anymore. See my answer to a related question here: http://stackoverflow.com/questions/19125249/highlight-top-button-in-uialertview/19125887#19125887 – Jörg Kirchhof Oct 06 '13 at 08:54
  • @IdanMoshe and your app got approved before iOS7 subclassing UIAlertView? – Unheilig Oct 06 '13 at 09:41
  • I didn't sent it yet but is it prohibited? – Idan Moshe Oct 06 '13 at 10:29