簡體   English   中英

在iOS Simulator 4和3.5英寸中加載新聞

[英]Loading news in both iOS Simulator 4 and 3.5 inches

我正在從我的應用程序中的rss feed中搜索新聞。 它在4英寸的iOS模擬器中工作,而在3.5英寸的iOS模擬器中不工作。 我的筆尖是一樣的。 關於這個問題有什么建議嗎? 提前致謝。 代碼如下。

    -(void)DownLoad:(NSNumber *)path{
        NSAutoreleasePool *pl = [[NSAutoreleasePool alloc] init];

        int index1 = [path intValue];
        NSString *Link = [ImgesName objectAtIndex:index1];
        UIImage *img = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:Link]]]; 
        if((img)&&([path intValue]<[ImgesName count]))
        {
            [dicImages_msg setObject:img forKey:[ImgesName objectAtIndex:index1]];
        }
        else
        {
            if([path intValue]<[ImgesName count])
            {
                [dicImages_msg setObject:[UIImage imageNamed:@"noImageAvailable.jpg"] forKey:[ImgesName objectAtIndex:index1]];
            }
        }
        [pl drain];
        [self performSelectorOnMainThread:@selector(reloadScrolview) withObject:nil waitUntilDone:YES];
    }

問題在於兩者的筆尖相同。 您需要根據電話的類型動態更改視圖高度。 可以通過以下代碼行[[UIScreen mainScreen] bounds].height找到高度。

暫無
暫無

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

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