滴滴

作者: b6e7b0be2603 | 来源:发表于2018-11-23 08:49 被阅读0次

AppDelegate.m

#import "AppDelegate.h"

#import "ViewController.h"

#import //头文件

@interface AppDelegate ()

//a5fc3eddf66f8727a7f47a9ca7ee0d34

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {

    ViewController *vie=[[ViewController alloc] init];

    UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:vie];

    self.window.rootViewController=nav;

    [[AMapServices sharedServices] setEnableHTTPS:YES];

    [AMapServices sharedServices].apiKey = @"a5fc3eddf66f8727a7f47a9ca7ee0d34";

    return YES;

}

viewController.m

#import "ViewController.h"

#import

#import

#import "QRcodeViewController.h"

#import "ZBarSDK.h"

#define HCWidth self.view.frame.size.width

#define HCHeigth self.view.frame.size.height

#define hcheight [UIScreen mainScreen].bounds.size.height

@interface ViewController ()<UIScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ZBarReaderDelegate>//协议

{

    UIView*leftvie;//全局

    UIView*zhuvie;//全局

    UIButton*btn;//全局

    UITableView *tab;//全局

    UIImageView *img;//全局

    UIScrollView *vie;//全局

    NSArray*arr;//全局

}

@end

@implementation ViewController

- (void)viewDidLoad {

    [super viewDidLoad];

    //主标题

    self.navigationItem.title=@"个人热点:一个连接";

    //左按钮

//    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"13"] style:UIBarButtonItemStylePlain target:self action:nil];

    //右按钮

    self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"信息 (1)"] style:UIBarButtonItemStylePlain target:self action:nil];

    //右按钮

    self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"功能-扫一扫"] style:UIBarButtonItemStylePlain target:self action:@selector(tiao)];

    //    1.    点击左边按钮实现抽屉效果(

    //    2.    实现抽屉中的头像位置(

    //    3.    抽屉中的表格实现 ,并且输入图二的内容(

    //抽屉

    UIView *vie=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];

    btn=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];

    [btn setImage:[UIImage imageNamed:@"13"] forState:UIControlStateNormal];

    btn.layer.masksToBounds=YES;

    btn.layer.cornerRadius=20;

    [vieaddSubview:btn];

    [btn addTarget:self action:@selector(abc) forControlEvents:UIControlEventTouchUpInside];

    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:vie];

    //文本

    leftvie=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, hcheight)];

    leftvie.backgroundColor=[UIColor whiteColor];

    [self.view addSubview:leftvie];

    //图片

    img=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 300,hcheight )];

    img.image=[UIImage imageNamed:@"999"];

    [leftvie addSubview:img];

    img.backgroundColor = [UIColor redColor];

    zhuvie=[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, hcheight)];

    zhuvie.backgroundColor=[UIColor cyanColor];

    [self.view addSubview:zhuvie];

    zhuvie.backgroundColor = [UIColor redColor];

    // Do any additional setup after loading the view, typically from a nib.

    ///地图需要v4.5.0及以上版本才必须要打开此选项(v4.5.0以下版本,需要手动配置info.plist)

    [AMapServices sharedServices].enableHTTPS = YES;

    ///初始化地图

    MAMapView *_mapView = [[MAMapView alloc] initWithFrame:self.view.bounds];

    ///把地图添加至view

    [zhuvieaddSubview:_mapView];

    ///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码

    _mapView.showsUserLocation = YES;

    _mapView.userTrackingMode = MAUserTrackingModeFollow;

    vie=[[UIScrollView alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, 60)];

    vie.backgroundColor=[UIColor whiteColor];

    //添加图片

    for(inti = 0; i < 7; i++) {

        arr=@[@"单车",@"豪华车",@"快车",@"礼橙专车",@"出租车",@"等车",@"等车"];

        UILabel *tex=[[UILabel alloc] initWithFrame:CGRectMake(20+80*i, 0, 80, 60)];

        tex.textColor=[UIColor redColor];

        //设置文字交互

        //        tex.userInteractionEnabled = YES;

        tex.text=arr[i];

        [vieaddSubview:tex];

    }

    [zhuvie addSubview:vie];

    UIView * uiv = [[UIView alloc]initWithFrame:CGRectMake(0, 550, self.view.frame.size.width, 200)];

    UIImageView * imag = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200)];

    imag.image = [UIImage imageNamed:@"2"];

    [uivaddSubview:imag];

    [self.view addSubview:uiv];

}

-(void)abc{

    if(btn.selected==NO) {

        [UIView animateWithDuration:0.5 animations:^{

            zhuvie.transform=CGAffineTransformMakeTranslation(300, 0);

            self.navigationController.navigationBar.transform=CGAffineTransformMakeTranslation(300, 0);

        }];

        btn.selected=YES;

    }else{

        [UIView animateWithDuration:0.5 animations:^{

            zhuvie.transform=CGAffineTransformIdentity;

            self.navigationController.navigationBar.transform=CGAffineTransformIdentity;

        }];

        btn.selected=NO;

    }

}

-(void)tiao{

    //    1.    实现扫一扫,跳转到新的界面实现扫一扫

    ZBarReaderViewController * reader = [ZBarReaderViewController new];//初始化相机控制器

    reader.readerDelegate=self;

    reader.supportedOrientationsMask = ZBarOrientationMaskAll;//基本适配

    reader.showsHelpOnFail = YES;

    reader.scanCrop=CGRectMake(0, 0, 1, 1);

    ZBarImageScanner* scanner = reader.scanner;

    [scannersetSymbology:25config:0to:0];

    [self presentViewController:reader animated:YES completion:nil];

}

@end

"MapTypeViewController.m"

#import "MapTypeViewController.h"

#import

#import

@interface MapTypeViewController ()

@end

@implementationMapTypeViewController

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

    ///地图需要v4.5.0及以上版本才必须要打开此选项(v4.5.0以下版本,需要手动配置info.plist)

    [AMapServices sharedServices].enableHTTPS = YES;

    ///初始化地图

    MAMapView *_mapView = [[MAMapView alloc] initWithFrame:self.view.bounds];

    ///把地图添加至view

    [self.viewaddSubview:_mapView];

    MAUserLocationRepresentation *r = [[MAUserLocationRepresentation alloc] init];

    r.showsAccuracyRing = NO;///精度圈是否显示,默认YES

    r.showsHeadingIndicator = NO;///是否显示方向指示(MAUserTrackingModeFollowWithHeading模式开启)。默认为YES

    r.fillColor = [UIColor redColor];///精度圈 填充颜色, 默认 kAccuracyCircleDefaultColor

    r.strokeColor = [UIColor blueColor];///精度圈 边线颜色, 默认 kAccuracyCircleDefaultColor

    r.lineWidth = 2;///精度圈 边线宽度,默认0

    r.enablePulseAnnimation = NO;///内部蓝色圆点是否使用律动效果, 默认YES

    r.locationDotBgColor = [UIColor greenColor];///定位点背景色,不设置默认白色

    r.locationDotFillColor = [UIColor grayColor];///定位点蓝色圆点颜色,不设置默认蓝色

    r.image = [UIImage imageNamed:@"你的图片"]; ///定位图标, 与蓝色原点互斥

    [_mapViewupdateUserLocationRepresentation:r];

}

相关文章

  • 滴滴滴滴滴滴#

    四月中旬的杭州滋生了蚊子,嗡嗡嗡,嗡嗡嗡。这蚊子只在天黑后开咬,或许是刚开始尝甜头的缘故,包不大不小,不痛不痒,提...

  • 滴滴滴滴滴滴

    说实话,我今天已经想放弃了。我不想再坚持进行这个日更活动了。就我个人而言,我不排斥写文章,但也并不是特别喜欢写文章...

  • “滴滴”滴滴滴滴

    这两天微博热议的话题就是因乘坐滴滴顺风车而遇害的女孩儿。滴滴公司、公安机关被推到风口浪尖上,公众在微博平台上表达他...

  • 滴滴滴滴

    滴滴滴滴

  • 滴滴滴滴

    滴滴滴滴下雨了 滴滴滴滴堵车了 滴滴滴滴让一下 滴滴滴滴加塞了 滴滴滴滴不许插 滴滴滴滴生气了 滴滴滴滴向前了 滴...

  • 滴滴滴,滴滴滴~(649)

    2018年8月17号 星期五 多云 滴滴滴,滴滴滴,今天是个啥日子,咋都遇到些主观意识极强的人儿呢?从早上...

  • 滴滴滴

    这世间的悲痛太多了,我们不能一一都去知晓,知晓得多了,内心也多会有着不尽的惶恐和庆幸。惶恐的是这世间竟然还有这般事...

  • 滴滴滴

    吓到了……吓到了……我这是不小心撞到什么了?撞鬼了……吓得眼泪直流……是有多委屈……多痛……只有自己知道…… 上天...

  • 滴滴滴

    一滴,一滴,滴成喷泉的形状 两滴,三滴,滴成河流的悠长 四滴,五滴,滴成海一样的惆怅 六滴,七滴,再也忍不住 滴滴...

  • 滴滴滴!

    继续打卡!

网友评论

      本文标题:滴滴

      本文链接:https://www.haomeiwen.com/subject/mfnlqqtx.html