Files
OrderScheduling/Pods/DDMAMapKit_Private/DDMAMapKit_Private/Classes/DDMAMap/AnnotationView/DriveRouteCustomAnnotationView.m
T
2023-08-18 17:28:57 +08:00

38 lines
1.1 KiB
Objective-C

//
// DriveRouteCustomAnnotationView.m
// DDCategoryKit_Private
// Created by DDIsFriend on 2023/2/3.
#import "DriveRouteCustomAnnotationView.h"
@interface DriveRouteCustomAnnotationView ()
@end
@implementation DriveRouteCustomAnnotationView
- (id)initWithAnnotation:(id <MAAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
if (self) {
[self addSubview:self.customTextLabel];
self.customTextLabel.translatesAutoresizingMaskIntoConstraints = NO;
[NSLayoutConstraint activateConstraints:@[
[self.customTextLabel.heightAnchor constraintEqualToConstant:30],
[self.customTextLabel.bottomAnchor constraintEqualToAnchor:self.topAnchor constant:0],
[self.customTextLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
]];
}
return self;
}
// MARK: <Lazy>
- (UILabel *)customTextLabel{
if (_customTextLabel == nil) {
_customTextLabel = [[UILabel alloc] init];
}
return _customTextLabel;
}
@end