我正在我的应用程序中从 rss feed 中搜索新闻。它可以在 iOS Simulator 4 英寸位中工作,但不能在 iOS Simulator 3.5 英寸中工作。我的 Nib 也是一样的关于这个问题有什么建议吗? 提前致谢。代码如下。
-(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];
}
最佳答案
问题在于两者的 Nib 是相同的。您需要的是根据手机的类型动态更改 View 高度。查找高度可以通过以下代码行[[UIScreen mainScreen]bounds].height
来完成。
关于iphone - 在 iOS Simulator 4 和 3.5 英寸中加载新闻,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16505177/