iphone - 在 iOS Simulator 4 和 3.5 英寸中加载新闻

标签 iphone ios

我正在我的应用程序中从 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/

相关文章:

iphone - iphone 应用程序的安全登录和 session 管理

ios - 圆形 UIImageView 在某些设备上是方形的

ios - 加载以前从相机胶卷中保存的图像

ios - Xcode命令行测试执行问题

ios - 使用按钮将 childViewController 加载到 scrollview parent

ios - 如何在用户键入时创建增加框架大小而不是增加滚动大小的 TextView

iphone - 如何使像素适合位图UIImage中的指定颜色?

iPhone棋盘游戏: OpenGL ES or CoreGraphics?

ios - 当显示在 FlatList 顶部时,OnPress 后背景颜色变为黑色

android - 移动应用程序(iPhone/Android)应用程序从相机读取实时文本