123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- //
- // APCategoryViewController.m
- // westkissMob
- //
- // Created by iOS on 2023/5/27.
- //
- #import "APCategoryViewController.h"
- @interface APCategoryViewController ()
- @property (nonatomic, strong) UIButton *closeBt;
- @property (nonatomic, strong) UILabel *titleLB;
- @end
- @implementation APCategoryViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.searchTf.hidden = true;
-
- [self.topV addSubview:self.closeBt];
- [self.closeBt mas_makeConstraints:^(MASConstraintMaker *make) {
- make.bottom.equalTo(self.topV).offset(-10);
- make.right.equalTo(self.topV).offset(-22);
- make.width.height.equalTo(@40);
- }];
-
- [self.topV addSubview:self.titleLB];
- [self.titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
- make.width.equalTo(@130);
- make.height.equalTo(@40);
- make.centerX.equalTo(self.topV);
- make.bottom.equalTo(self.topV).offset(-10);
- }];
-
-
- }
- - (void)showAction {
- self.view.frame = CGRectMake(-SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- self.view.hidden = false;
- [UIView animateWithDuration:0.24 animations:^{
- self.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- } completion:^(BOOL finished) {
- self.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- }];
- }
- - (void)closeAction {
- self.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- [UIView animateWithDuration:0.24 animations:^{
- self.view.frame = CGRectMake(-SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- } completion:^(BOOL finished) {
- self.view.frame = CGRectMake(-SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- self.view.hidden = true;
- }];
- }
- - (UIButton *)closeBt {
- if (!_closeBt) {
- UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
- [bt setImage:[UIImage imageNamed:@"productLsit_filter_close"] forState:UIControlStateNormal];
- [bt addTarget:self action:@selector(closeAction) forControlEvents:UIControlEventTouchUpInside];
- _closeBt = bt;
- }
- return _closeBt;
- }
- - (UILabel *)titleLB {
- if (!_titleLB) {
- UILabel *lb = [[UILabel alloc] init];
- lb.text = @"MENU";
- lb.textColor = UIColor.blackColor;
- lb.font = [UIFont fontWithName:Rob_Regular size:20];
- lb.textAlignment = NSTextAlignmentCenter;
- _titleLB = lb;
- }
- return _titleLB;
- }
- @end
|