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];

     

  • 相关阅读:
    移动Web开发规范概述
    hibernate 多对多
    hibernate 1 对1
    hibernate 双向1对多
    Hibernate 单项多对1
    Hibernate Session 4种对象状态
    Hibernate Session缓存
    Hibernaate 详解
    Hibernate学习 (一)
    Struts拦截器Interceptor
  • 原文地址:https://www.cnblogs.com/gaozhang12345/p/8867193.html
Copyright © 2011-2022 走看看