UIImageView没有在iOS6上显示

时间:2013-07-15 09:09:40

标签: ios uiimageview

在ios5中我实现了我的UIImageView:

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"FirstScreen.png"]];

imageView.frame =  CGRectMake(0.0,0.0,[GeneralUtils screenWidth],[GeneralUtils screenHeight]);

// !!!!!!!!!!!!!
[self.view addSubview: imageView];
[self.view sendSubviewToBack:imageView];
[self.view sendSubviewToBack:self.tableView];

一切都很好......但现在在ios6中,我的UIImageView不再显示了......

2 个答案:

答案 0 :(得分:1)

尝试下面的代码..

CGRect screenBounds = [[UIScreen mainScreen] bounds];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"FirstScreen.png"]];

imageView.frame =  screenBounds;

[self.view addSubview:imageView];
[self.view bringSubviewToFront:self.tableView];
[self.tableView setBackgroundColor:[UIColor clearColor]];

答案 1 :(得分:0)

通过设置

解决了这个问题
[self.tableView setBackgroundView: nil];

我认为我的tableView隐藏了Image!