zoukankan      html  css  js  c++  java
  • IOS添加多个按钮在导航栏

     UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 75.0f, 30.0f)];
            
            UIButton *editorCityBtn = [UIButton buttonWithType:UIButtonTypeCustom];
            [editorCityBtn setFrame:CGRectMake(0.0f, 0.0f, 30.0f, 30.0f)];
            [editorCityBtn setBackgroundImage:MF_PngWithSkin(@"Defaults", @"other60.png") forState:UIControlStateNormal];
            [editorCityBtn addTarget:self action:@selector(editorCityBtnClick:) forControlEvents:UIControlEventTouchUpInside];
            [customView addSubview:editorCityBtn];
            
            UIButton *addCityBtn = [UIButton buttonWithType:UIButtonTypeCustom];
            [addCityBtn setFrame:CGRectMake(35.0f, 0.0f, 30.0f, 30.0f)];
            [addCityBtn setBackgroundImage:MF_PngWithSkin(@"Defaults", @"ico_promotion43x42.png") forState:UIControlStateNormal];
            [addCityBtn addTarget:self action:@selector(addCityBtnClick:) forControlEvents:UIControlEventTouchUpInside];
            [customView addSubview:addCityBtn];
            
            UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithCustomView:customView];
            [self.navigationItem setRightBarButtonItem:rightBtn];
  • 相关阅读:
    S2dao 简单Demo(转)
    Iphone SDK textField 打开和关闭键盘
    s2dao 入门知识2
    Eclipse tomcat Web页面调试
    s2dao 入门知识1
    java 面试
    Iphone SDK ActionSheet 在当前窗口弹出时间选择
    杭电2044
    杭电2076
    杭电2077
  • 原文地址:https://www.cnblogs.com/joesen/p/3628354.html
Copyright © 2011-2022 走看看