diff --git a/src/ios/GMImagePicker/GMAlbumsViewCell.m b/src/ios/GMImagePicker/GMAlbumsViewCell.m index ee1996ef..9eef1e93 100755 --- a/src/ios/GMImagePicker/GMAlbumsViewCell.m +++ b/src/ios/GMImagePicker/GMAlbumsViewCell.m @@ -30,6 +30,9 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus //self.textLabel.backgroundColor = self.backgroundColor; //self.detailTextLabel.backgroundColor = self.backgroundColor; + self.titleLabel.backgroundColor = self.backgroundColor; + self.infoLabel.backgroundColor = self.backgroundColor; + self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; //Border width of 1 pixel: @@ -97,39 +100,53 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus //TextLabel - self.textLabel.font = [UIFont fontWithName:@"Helvetica" size:17.0]; - self.textLabel.numberOfLines = 1; - self.textLabel.translatesAutoresizingMaskIntoConstraints = NO; +// self.textLabel.font = [UIFont fontWithName:@"Helvetica" size:17.0]; +// self.textLabel.numberOfLines = 1; +// self.textLabel.translatesAutoresizingMaskIntoConstraints = NO; + + self.titleLabel = [UILabel new]; + self.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:17.0]; + self.titleLabel.numberOfLines = 1; + self.titleLabel.translatesAutoresizingMaskIntoConstraints = NO; + self.titleLabel.adjustsFontSizeToFitWidth = YES; + [self.contentView addSubview:self.titleLabel]; + +// self.detailTextLabel.font = [UIFont fontWithName:@"Helvetica" size:14.0]; +// self.detailTextLabel.numberOfLines = 1; +// self.detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; - self.detailTextLabel.font = [UIFont fontWithName:@"Helvetica" size:14.0]; - self.detailTextLabel.numberOfLines = 1; - self.detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; + self.infoLabel = [UILabel new]; + self.infoLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:14.0]; + self.infoLabel.numberOfLines = 1; + self.infoLabel.translatesAutoresizingMaskIntoConstraints = NO; + self.infoLabel.adjustsFontSizeToFitWidth = YES; + [self.contentView addSubview:self.infoLabel]; //Set next text labels contraints : - [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView1]-(offset)-[textLabel]-|" + [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView1]-(offset)-[titleLabel]-|" options:0 metrics:@{@"offset": @(kAlbumImageToTextSpace)} - views:@{@"textLabel": self.textLabel, + views:@{@"titleLabel": self.titleLabel, @"imageView1": self.imageView1}]]; - [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView1]-(offset)-[detailTextLabel]-|" + [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[imageView1]-(offset)-[infoLabel]-|" options:0 metrics:@{@"offset": @(kAlbumImageToTextSpace)} - views:@{@"detailTextLabel": self.detailTextLabel, + views:@{@"infoLabel": self.infoLabel, @"imageView1": self.imageView1}]]; - [self.contentView addConstraints:@[[NSLayoutConstraint constraintWithItem:self.textLabel + [self.contentView addConstraints:@[[NSLayoutConstraint constraintWithItem:self.titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual - toItem:self.textLabel.superview + toItem:self.titleLabel.superview attribute:NSLayoutAttributeCenterY multiplier:1.f constant:0.f]]]; - [self.contentView addConstraints:@[[NSLayoutConstraint constraintWithItem:self.detailTextLabel + [self.contentView addConstraints:@[[NSLayoutConstraint constraintWithItem:self.infoLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual - toItem:self.textLabel.superview + toItem:self.titleLabel.superview attribute:NSLayoutAttributeCenterY multiplier:1.f constant:+4.f]]]; } diff --git a/src/ios/GMImagePicker/GMAlbumsViewController.m b/src/ios/GMImagePicker/GMAlbumsViewController.m index 48bc0132..e791d3b6 100755 --- a/src/ios/GMImagePicker/GMAlbumsViewController.m +++ b/src/ios/GMImagePicker/GMAlbumsViewController.m @@ -262,7 +262,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.tag = currentTag; //Set the label - cell.textLabel.text = (self.collectionsFetchResultsTitles[indexPath.section])[indexPath.row]; + cell.titleLabel.text = (self.collectionsFetchResultsTitles[indexPath.section])[indexPath.row]; //Retrieve the pre-fetched assets for this album: PHFetchResult *assetsFetchResult = (self.collectionsFetchResultsAssets[indexPath.section])[indexPath.row]; @@ -270,7 +270,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N //Display the number of assets if(self.picker.displayAlbumsNumberOfAssets) { - cell.detailTextLabel.text = [self tableCellSubtitle:assetsFetchResult]; + cell.infoLabel.text = [self tableCellSubtitle:assetsFetchResult]; } //Set the 3 images (if exists): @@ -353,12 +353,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; + GMAlbumsViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; //Init the GMGridViewController GMGridViewController *gridViewController = [[GMGridViewController alloc] initWithPicker:[self picker]]; //Set the title - gridViewController.title = cell.textLabel.text; + gridViewController.title = cell.titleLabel.text; //Use the prefetched assets! gridViewController.assetsFetchResults = [[_collectionsFetchResultsAssets objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]; gridViewController.dic_asset_fetches = dic_asset_fetches; @@ -442,4 +442,4 @@ - (NSString *)tableCellSubtitle:(PHFetchResult*)assetsFetchResult -@end \ No newline at end of file +@end diff --git a/src/ios/GMImagePicker/GMGridViewCell.m b/src/ios/GMImagePicker/GMGridViewCell.m index 0e78d3a2..d7b5c0be 100755 --- a/src/ios/GMImagePicker/GMGridViewCell.m +++ b/src/ios/GMImagePicker/GMGridViewCell.m @@ -68,8 +68,8 @@ - (id)initWithFrame:(CGRect)frame _imageView.contentMode = UIViewContentModeScaleAspectFill; }*/ _imageView.clipsToBounds = YES; - _imageView.translatesAutoresizingMaskIntoConstraints = NO; - _imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + //_imageView.translatesAutoresizingMaskIntoConstraints = NO; + //_imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; [self addSubview:_imageView]; @@ -214,4 +214,4 @@ -(NSString*)getDurationWithFormat:(NSTimeInterval)duration return [NSString stringWithFormat:@"%02ld:%02ld", (long)minutes, (long)seconds]; } -@end \ No newline at end of file +@end