iphone - iOS : Load image from plist file
<p><p>我正在尝试将 plist 文件中的各种图像显示到 UIImageView 中,我这样编写代码:</p>
<pre><code>NSDictionary *picturesDictionary = pathForResource:@"Photos" ofType:@"plist"]];
imageArray = ;
PhotosInAlbum.image = ];
</code></pre>
<p>但实际上什么也没发生,我的 ImageView 是空的!我还有两个按钮可以向前向后图像。 </p>
<p>Plist 的内容:
<img src="/image/vpkGj.png" alt="enter image description here"/> </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>plist不正确,应该是</p>
<pre><code>Root ---- Dictionary
PhotosArray ----- Array
Item 0 ------ String -- Beach.jpg
</code></pre>
<p>然后将此代码添加到您的 viewController.. 确保 Interface imageView 链接到 IBOutlet。</p>
<pre><code>NSDictionary *picturesDictionary = pathForResource:@"Photos" ofType:@"plist"]];
NSArray *imageArray = ;
PhotosInAlbum.image = ];
</code></pre></p>
<p style="font-size: 20px;">关于iphone - iOS : Load image from plist file,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/10846620/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/10846620/
</a>
</p>
页:
[1]