iphone - 如何在 ScrollView 中显示图像列表,其中图像是从 iPhone 中的 URL XML 文件中检索的

标签 iphone ios ios6

我可以从网络服务器的 XML 文件中检索图像并将图像列为 ScrollView 。现在我想单击一个图像,该图像应将我带到另一个窗口,该窗口应再次显示一些图像作为 Collection View 。谁能建议我如何做到这一点。

我列出了我的 TableView Controller 和我需要的现有引用图像。

MyTableViewController.m

- (void)viewDidLoad{
     [super viewDidLoad];
     xmlParser = [[egsXMLParser alloc] loadXMLByURL:@"http://retrieveurlxml.com/sample.xml"];
     [self.tableView reloadData];
   }



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
        static NSString *CellIdentifier = @"myimages";
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
        } UIImage *currentTweet = [[xmlParser tweets] objectAtIndex:indexPath.row];
        UIImageView *tweetImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0,cell.frame.size.width , cell.frame.size.height)];
        tweetImageView.image = currentTweet;
        [cell setBackgroundView:tweetImageView];
        return cell;
    }

我当前的 ScrollView 如下所示,

Current Table view of images scrolling

我需要的是如下所示,

任何人都可以建议我如何实现这样的目标。 Desired output

最佳答案

只需使用我通过电子邮件发送给您的 API。要调用此 API:

ASyncImage *img_EventImag = alloc with frame;
NSURL *url = yourURL;
[img_EventImage loadImageFromURL:url];
[self.view addSubView:img_EventImage]; // In your case you'll add in your TableViewCell.

关于iphone - 如何在 ScrollView 中显示图像列表,其中图像是从 iPhone 中的 URL XML 文件中检索的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14557405/

相关文章:

iphone - 如何将关键字#define 生成的常量值作为参数传递给方法?

iphone - 将 NSString 转换为 NSData 时出现问题

ios - 在另一个函数中调用返回类型别名值的函数

ios - 如何在 tvOS 的同一 View 中显示 UISearchController?

ios - CGAffineTransformMakeRotation 不调整 iOS 6 中的 View 大小

xcode - 如何使用延迟位置 iOS 6?

ios - 如何更改Appstore应用程序URL? (从特定地区到全局)

iphone - iOS:应用程序未出现在设置中的通知中心

ios - 我的天气数据没有显示在我的 View Controller 中

iphone - 我的 iPhone 应用程序应该使用哪种风格