, UIViewController, bottomLayoutGuide. , .
bottomLayoutGuide UIViewController, MyLayoutGuide, :
@interface MyLayoutGuide : NSObject <UILayoutSupport>
@property (nonatomic) CGFloat length;
-(id)initWithLength:(CGFloat)length;
@end
@implementation MyLayoutGuide
@synthesize length = _length;
@synthesize topAnchor = _topAnchor;
@synthesize bottomAnchor = _bottomAnchor;
@synthesize heightAnchor = _heightAnchor;
- (id)initWithLength:(CGFloat)length
{
if (self = [super init]) {
_length = length;
}
return self;
}
@end
bottomLayoutGuide, MKMapView 50:
- (id)bottomLayoutGuide
{
CGFloat bottomLayoutGuideLength = 50.f;
return [[MyLayoutGuide alloc] initWithLength:bottomLayoutGuideLength];
}
"", setNeedsLayout MKMapView, . MKMapView, UIViewController:
- (void)updateBottomLayoutGuides
{
[self.mapView setNeedsLayout];
}
.