Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 集合视图在iphone和ipad上都可用,但在ipad上显示一半_Ios_Iphone_Objective C_Ipad_Uicollectionview - Fatal编程技术网

Ios 集合视图在iphone和ipad上都可用,但在ipad上显示一半

Ios 集合视图在iphone和ipad上都可用,但在ipad上显示一半,ios,iphone,objective-c,ipad,uicollectionview,Ios,Iphone,Objective C,Ipad,Uicollectionview,在我的应用程序中,我使用集合视图,就像我在Xib中使用的一样。现在有一个来自服务器端的数组映像。在iPhone3.5和4英寸的屏幕上都能正确地看到它们。但当我选择设备为ipad时,看起来是这样的: 出现三行,我不知道如何解决这个问题。我只想要一行可以滚动 这是我的密码: -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { return 1; } -(NSInteger)co

在我的应用程序中,我使用集合视图,就像我在Xib中使用的一样。现在有一个来自服务器端的数组映像。在iPhone3.5和4英寸的屏幕上都能正确地看到它们。但当我选择设备为ipad时,看起来是这样的:

出现三行,我不知道如何解决这个问题。我只想要一行可以滚动

这是我的密码:

-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return 1;
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return [imagArr count];
}

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    QBAssetsCollectionViewCell *cell = (QBAssetsCollectionViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"QBAssetsCollectionViewCell" forIndexPath:indexPath];

    NSDictionary *imageName = [[imagArr objectAtIndex:indexPath.row] objectForKey:@"Content"];
    NSString *sr = [imageName objectForKey:@"text"];
    cell.Img.image = [self decodeBase64ToImage:sr];
    //[cell updateCell];

    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"%ld",(long)indexPath.row);

    NSDictionary *imageName = [[imagArr objectAtIndex:indexPath.row] objectForKey:@"Content"];
    NSString *sr = [imageName objectForKey:@"text"];
    cloud.image= [self decodeBase64ToImage:sr];
    [self.collectionView setHidden:YES];
}

autoloyout
是否启用?设置iPad的框架…………并检查Autolayout@Pawan-都对了兄弟你找到解决办法了吗?@parvendrasing没有解决兄弟