Ios 集合视图在iphone和ipad上都可用,但在ipad上显示一半
在我的应用程序中,我使用集合视图,就像我在Xib中使用的一样。现在有一个来自服务器端的数组映像。在iPhone3.5和4英寸的屏幕上都能正确地看到它们。但当我选择设备为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
-(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没有解决兄弟