• 自定义UIToolbar


    UIToolbar *myToolBar = [[UIToolbar alloc] initWithFrame:
                                CGRectMake(0.0f0.0f320.0f44.0f)];
        NSMutableArray *myToolBarItems = [NSMutableArray array];
        [myToolBarItems addObject:[[UIBarButtonItem alloc]
                                    initWithTitle:@"myTile"
                                    style:UIBarButtonItemStylePlain
                                    target:self
                                    action:@selector(action)]];
        
        //在UIToolBar上面添加image
        [myToolBarItems addObject:[[UIBarButtonItem alloc]
                                    initWithImage:[UIImage imageNamed:@"myImage.png"]
                                    style:UIBarButtonItemStylePlain
                                    target:self
                                   action:@selector(action)]];
         
         //在UIToolBar上面添加SystemItem
         [myToolBarItems addObject:[[UIBarButtonItem alloc]
                                     initWithBarButtonSystemItem:UIBarButtonSystemItemPlay
                                     target:self
                                     action:@selector(action)]];
     
         //加一个进度条UIProgressView//添加自定义东西要,initWithCustomView
         UIProgressView *myProgress = [[UIProgressView alloc] initWithFrame:CGRectMake(65.0f20.0f90.0f10.0f)];  
         UIBarButtonItem *myButtonItem = [[UIBarButtonItem alloc]initWithCustomView:myProgress];  
         [myToolBarItems addObject: myButtonItem];
        
         [myToolBar setItems:myToolBarItems animated:YES];
         [self.view addSubview:myToolBar];//or set toolbar show  no hidden
  • 相关阅读:
    npm ci命令解析
    performance分析
    mpvue 引入直播功能
    lodash按需加载
    React生命周期分析
    vue 项目打包优化(远不止dll)
    Git 底层数据结构和原理
    Docker 部署 Nuxt.js 项目
    TMS320DM642调试出现#10247-D creating output section ".capChaACrSpace" without a SECTIONS 解决办法
    TMS320DM642的emif(外部存储器接口)的结构设置
  • 原文地址:https://www.cnblogs.com/ioschen/p/3419569.html
Copyright © 2020-2023  润新知