zoukankan      html  css  js  c++  java
  • iOS导航栏左边按钮图像变形

    /添加一个view 用来存放btn
        UIView *iconBgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 25, 25)];
        leftButton = [[CDLeftBtn alloc]init];
        leftButton.layer.masksToBounds = YES;
        leftButton.frame = CGRectMake(0, 0, 25, 25);
        leftButton.layer.cornerRadius = 12.5;
        [CDUtils displayLeftBtnImageWithUrlUnderMyIcon:icon.length>0?icon:[CDUser currentUser].avatarUrl button:leftButton];
        [iconBgView addSubview:leftButton];
        [leftButton addTarget:self action:@selector(leftBtnCilck) forControlEvents:UIControlEventTouchUpInside];
        UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:iconBgView];
        self.navigationItem.leftBarButtonItem = leftItem;
    ///就是加一层,

    UIView *iconBgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 25, 25)];

        UIButton * backbtn =[UIButton addBtnImage:@"backimg" AndFrame:CGRectMake(0, 0, 25, 25) WithTarget:self action:@selector(leftBtnClick)];

        backbtn.layer.masksToBounds = YES;

        backbtn.layer.cornerRadius = 12.5;

        [iconBgView addSubview:backbtn];

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

     

  • 相关阅读:
    入职一家新公司
    简单的线性数据比较
    python编程导论读书笔记【4】终章
    Hadoop构建数据仓库实践读书笔记【3】__数据仓库设计基础
    清北最后冲刺 张浩威 吃鱼
    新汉诺塔
    小朋友的数字
    硬币购物
    HH的项链
    求逆序对 && 逆序对数列
  • 原文地址:https://www.cnblogs.com/gaozhang12345/p/8867193.html
Copyright © 2011-2022 走看看