簡體   English   中英

圖像未顯示在較新的iPad設備(如iPad Air,iPad3)上,但顯示在模擬器iOS 8.1上

[英]Images not displayin on newer iPad devices like iPad Air, iPad3 but displaying on simulator iOS 8.1

我正在開發僅在iPad上運行的應用程序。 “資源”文件夾中的圖像未顯示在新一代iPad和iPad Air上,但是當在Xcode Simulator中將iPad Air選擇為目標時,它們顯示得很好。 在項目中,我們同時具有@ 1x(圖像尺寸:14 * 14)和@ 2x(圖像尺寸:28 * 28)圖像。

另外,我檢查了文件名,它們是否匹配。 任何幫助或建議,將不勝感激。 非常感謝

請在下面找到代碼:

@屬性(非原子的,弱的)UIButton * expandAllButton;

self.expandAllButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.expandAllButton.frame = CGRectMake(10, 10, 32, 44);
[self.expandAllButton setImage:[UIImage imageNamed:@"ExpandAll.png"] forState:UIControlStateNormal];

編輯:如果有人面臨相同的問題,我通過將按鈕從弱引用更改為強引用來解決。 當我們將IBOutlet應用於按鈕時,它具有弱引用,但是后來我們將其刪除,卻忘記將其更改為強引用。

@property(非原子的,強的)UIButton * expandAllButton;

看來是64位設備問題。 您提到的新設備是64位設備。

其他一些用戶對於64位設備也有同樣的問題。 盡管正確實現了某些圖像,但是在64位設備中,捆綁包中未顯示某些圖像。

您可以檢查此SO Answer 它可以解決您的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM