[ios] Fixed search layout for ios 7.

This commit is contained in:
Ilya Grechuhin 2016-06-03 14:53:18 +03:00 committed by Vladimir Byko-Ianko
parent 4d4327df75
commit 970d617f4b
5 changed files with 57 additions and 0 deletions

View file

@ -1,4 +1,5 @@
#import "BookmarksVC.h"
#import "Common.h"
#import "MWMSearchBookmarksCell.h"
#import "UIColor+MapsMeColor.h"
#import "UIFont+MapsMeFonts.h"
@ -43,6 +44,17 @@
self.titleLabel.text = @(cat->GetName().c_str());
}
- (void)layoutSubviews
{
[super layoutSubviews];
if (isIOS7)
{
self.titleLabel.preferredMaxLayoutWidth = floor(self.titleLabel.width);
self.countLabel.preferredMaxLayoutWidth = floor(self.countLabel.width);
[super layoutSubviews];
}
}
- (IBAction)toggleVisibility
{
self.isVisible = !self.isVisible;

View file

@ -1,3 +1,4 @@
#import "Common.h"
#import "Macros.h"
#import "MWMSearchCategoryCell.h"
#import "UIColor+MapsMeColor.h"
@ -22,6 +23,16 @@
sl.rasterizationScale = UIScreen.mainScreen.scale;
}
- (void)layoutSubviews
{
[super layoutSubviews];
if (isIOS7)
{
self.label.preferredMaxLayoutWidth = floor(self.label.width);
[super layoutSubviews];
}
}
- (void)setCategory:(NSString *)category
{
self.label.text = L(category);

View file

@ -29,6 +29,16 @@
[self layoutIfNeeded];
}
- (void)layoutSubviews
{
[super layoutSubviews];
if (isIOS7)
{
self.title.preferredMaxLayoutWidth = floor(self.title.width);
[super layoutSubviews];
}
}
+ (CGFloat)defaultCellHeight
{
return 44.0;

View file

@ -1,3 +1,4 @@
#import "Common.h"
#import "MWMSearchCell.h"
#import "Statistics.h"
#import "UIColor+MapsMeColor.h"
@ -66,6 +67,16 @@
[self.titleLabel sizeToFit];
}
- (void)layoutSubviews
{
[super layoutSubviews];
if (isIOS7)
{
self.titleLabel.preferredMaxLayoutWidth = floor(self.titleLabel.width);
[super layoutSubviews];
}
}
- (NSDictionary *)selectedTitleAttributes
{
return nil;

View file

@ -72,6 +72,19 @@
[self layoutIfNeeded];
}
- (void)layoutSubviews
{
[super layoutSubviews];
if (isIOS7)
{
self.typeLabel.preferredMaxLayoutWidth = floor(self.typeLabel.width);
self.infoLabel.preferredMaxLayoutWidth = floor(self.infoLabel.width);
self.locationLabel.preferredMaxLayoutWidth = floor(self.locationLabel.width);
self.distanceLabel.preferredMaxLayoutWidth = floor(self.distanceLabel.width);
[super layoutSubviews];
}
}
- (void)setInfoText:(NSString *)infoText
{
self.infoView.hidden = NO;