相关疑难解决方法(0)

试图显示图像数组,代码将iphone返回主屏幕

这是问题代码:

代码是显示一个图像数组,然后可以滚动浏览.

- (void)viewDidLoad {
    [super viewDidLoad];

    NSArray *photos = [[NSArray arrayWithObjects:   
                        [UIImage imageNamed:@"Event.png"],
                        [UIImage imageNamed:@"Logo.png"],
                        [UIImage imageNamed:@"default.png"],
                        [UIImage imageNamed:@"LittleLogoImage.png"],
                        nil] retain];      // TODO – fill with your photos

    // note that the view contains a UIScrollView in aScrollView

    int i=0;
    int width = 0;
    int height = 0;
    for ( NSString *image in photos )
    {
        UIImage *image = [UIImage imageNamed:[photos objectAtIndex:i]];
        UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
        imageView.contentMode = UIViewContentModeScaleAspectFit;
        imageView.clipsToBounds = YES;

        imageView.frame = CGRectMake( imageView.frame.size.width * …
Run Code Online (Sandbox Code Playgroud)

arrays iphone image objective-c ios

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

arrays ×1

image ×1

ios ×1

iphone ×1

objective-c ×1