简体   繁体   English

从服务器获取多个URL图像并在iPhone中的scrollview中显示

[英]get multiple url image from server and show in scrollview in iphone

can anyone please tell me how to get url image ans show in uiscrollview in tableview. 谁能告诉我如何在uiscrollview的tableview中显示网址图片和显示。 I am struggling from last three days but not output.:( 我最近三天都在挣扎,但没有输出。

<slider1>
 <item>
 <thumbNail>http://www.bizfy.com/demo/biscoot/a1.png</thumbNail>
   <contentId>img001</contentId>
   </item>
  <item>
     <thumbNail>http://www.bizfy.com/demo/biscoot/a1.png</thumbNail>
    <contentId>img002</contentId>
  </item>
  <item>
  <thumbNail>http://www.bizfy.com/demo/biscoot/a1.png</thumbNail>
    <contentId>img003</contentId>
     </item>
    <item>
    <thumbNail>http://www.bizfy.com/demo/biscoot/a1.png</thumbNail>
    <contentId>img004</contentId>
     </item>
     <item>
     <thumbNail>http://www.bizfy.com/demo/biscoot/a1.png</thumbNail>
  <contentId>img005</contentId>
   </item>
   </slider1>

I want to store all images url and show in uiscrollview in tableview cell. 我想存储所有图像url,并在uiscrollview中的tableview单元中显示。 Please suggest me. 请给我建议。

where is the complication? 并发症在哪里?

Parse the XML to get all urls. 解析XML得到的所有URL。 Put these urls in a NSArray . 把这些URL中NSArray Now feed this NSArray as a datasource to a UITableView instance. 现在将此NSArray作为datasource提供给UITableView实例。 Make sure the UITableViewCell has a UIImageView in it so that you can insert the image urls when scroll happens. 确保UITableViewCell具有UIImageView ,以便在发生滚动时可以插入图像URL。 Thats it, this is all there is to it. 就是这样,这就是全部。

One more important point, assigning url to uiimageview in main UI thread will hang the UI as it is downloading the image in the main thread. 更重要的一点是,在将UI下载到主线程中的图像时,在主UI线程中向uiimageview分配url uiimageview UI挂起。 So you will have to do the image downloading in a spawned background thread and then once the image has been downloaded update the uimageview in the main UI thread. 因此,您将不得不在生成的后台线程中进行图像下载,然后一旦下载了图像, uimageview在主UI线程中更新uimageview This way the user experience would be smooth. 这样,用户体验将变得流畅。

Since you have not posted any code, neither am i... 由于您尚未发布任何代码,因此我也不会...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM