123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- //
- // XMGBaseViewC.m
- // 振飞商城
- //
- // Created by 123 on 2020/5/10.
- // Copyright © 2020 Vibration Fly. All rights reserved.
- //
- #import "XMGMyBaseVC.h"
- @interface XMGMyBaseVC ()
- @end
- @implementation XMGMyBaseVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- self.view.backgroundColor=kRGBColor(250, 250, 250);
- }
- - (void)defineNavBarSiDai:(NSString *)title andRinghtBtnImg:(NSString *)image
- {
- UIView *navView = [[UIView alloc] init];
-
- [self.view addSubview:navView];
-
- navView.frame = CGRectMake(0, 0, JX_SCREEN_WIDTH,JX_SCREEN_TOP);
- UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- backBtn.frame = CGRectMake(0,JX_SCREEN_HEIGHT>812?44:20,44, 44);
- [backBtn setImage:[UIImage imageNamed:@"photo_title_back_black"] forState:0];
- backBtn.tag = 1001;
- [backBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
- [navView addSubview:backBtn];
-
- UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- rightBtn.frame = CGRectMake(100,(JX_SCREEN_HEIGHT>812?44:20), JX_SCREEN_WIDTH-200, 44);
- [rightBtn setTitle:title forState:UIControlStateNormal];
- [rightBtn setImage:[UIImage imageNamed:title] forState:UIControlStateNormal];
- rightBtn.layer.cornerRadius=5;
- rightBtn.layer.masksToBounds=YES;
- rightBtn.tag =1002;
- //[rightBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
- [navView addSubview:rightBtn];
- self.rightBtn=rightBtn;
-
-
-
- }
- - (void)defineNavBarXXX:(NSString *)title andRinghtBtnImg:(NSString *)image
- {
- UIView *navView = [[UIView alloc] init];
-
- [self.view addSubview:navView];
-
- navView.frame = CGRectMake(0, 0, JX_SCREEN_WIDTH,JX_SCREEN_TOP);
- UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- backBtn.frame = CGRectMake(0,JX_SCREEN_HEIGHT>812?44:20,44, 44);
- [backBtn setImage:[UIImage imageNamed:@"photo_title_back_black"] forState:0];
- backBtn.tag = 1001;
- [backBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
- [navView addSubview:backBtn];
-
- UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50,(JX_SCREEN_HEIGHT>812?44:20), JX_SCREEN_WIDTH-100, 44)];
- label.text = title;
- if ([image isEqualToString:@"1000"]) {
- label.textColor = [UIColor whiteColor];
- navView.backgroundColor = [UIColor clearColor];
- }else{
- label.textColor = kRGBColor51;
- navView.backgroundColor = [UIColor whiteColor];
- }
- label.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
- label.textAlignment = NSTextAlignmentCenter;
- [navView addSubview:label];
-
- if ([image isEqualToString:@"222"]) {
-
- }else if ([image isEqualToString:@"zhuanpan"]) {
-
- }else{
- UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- rightBtn.frame = CGRectMake(JX_SCREEN_WIDTH-64,(JX_SCREEN_HEIGHT>812?44:20), 51, 30);
- [rightBtn setTitle:image forState:UIControlStateNormal];
- rightBtn.layer.cornerRadius=5;
- rightBtn.layer.masksToBounds=YES;
- rightBtn.backgroundColor=[UIColor redColor];
- rightBtn.tag =1002;
- //[rightBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
- [navView addSubview:rightBtn];
- self.rightBtn=rightBtn;
- }
-
-
- }
- - (void)defineNavBar:(NSString *)title andRinghtBtnImg:(NSString *)image
- {
- UIView *navView = [[UIView alloc] init];
-
- [self.view addSubview:navView];
-
- navView.frame = CGRectMake(0, 0, JX_SCREEN_WIDTH,JX_SCREEN_TOP);
- UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- backBtn.frame = CGRectMake(0,JX_SCREEN_HEIGHT>812?44:20,44, 44);
- [backBtn setImage:[UIImage imageNamed:@"photo_title_back_black"] forState:0];
- backBtn.tag = 1001;
- [backBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
- [navView addSubview:backBtn];
-
- UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50,(JX_SCREEN_HEIGHT>812?44:20), JX_SCREEN_WIDTH-100, 44)];
- label.text = title;
- if ([image isEqualToString:@"1000"]) {
- label.textColor = [UIColor whiteColor];
- navView.backgroundColor = [UIColor clearColor];
- }else{
- label.textColor = kRGBColor51;
- navView.backgroundColor = [UIColor whiteColor];
- }
- label.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
- label.textAlignment = NSTextAlignmentCenter;
- [navView addSubview:label];
-
- // UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- // rightBtn.frame = CGRectMake(kScreenWidth-44,kTopStateHight, 44, 44);
- // [rightBtn setImage:[UIImage imageNamed:@"矢量智能对象"] forState:0];
- // rightBtn.tag =1002;
- // [rightBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
- // [navView addSubview:rightBtn];
-
- }
- - (void)click1:(UIButton *)btn{
-
- [self.navigationController popViewControllerAnimated:YES];
- }
- - (void)click:(UIButton *)btn{
-
- [g_navigation dismissViewController:self animated:YES];
-
- }
- @end
|