zoukankan      html  css  js  c++  java
  • 改变self.editButtonItem.title

     1 - (void)viewDidLoad
     2 {
     3     [super viewDidLoad];
     4     
     5     self.editButtonItem.possibleTitles = [NSSet setWithObjects:@"编辑", @"完成", nil];
     6     self.editButtonItem.title = @"编辑";
     7     self.navigationItem.leftBarButtonItem = self.editButtonItem;
     8 }
     9 
    10 - (void)setEditing:(BOOL)editing 
    11           animated:(BOOL)animated
    12 {
    13     [super setEditing:editing animated:animated];
    14     
    15     if (self.editing) {
    16         self.editButtonItem.title = @"完成";
    17     } else {
    18         self.editButtonItem.title = @"编辑";
    19     }
    20 }
     1 possibleTitles
     2 The set of possible titles to display on the bar button.
     3 
     4 @property(nonatomic, copy) NSSet *possibleTitles
     5 Discussion
     6 Use this property to provide a hint to the system on how to correctly size the bar button item to be wide enough to accommodate your widest title. Set the value of this property to an NSSet object containing all the titles you intend as possible titles for the bar button item. Use the actual text strings you intend to display.
     7 
     8 This property applies to bar button items placed on navigation bars or toolbars.
     9 
    10 Availability
    11 Available in iOS 2.0 and later.
    12 Related Sample Code
    13 AccelerometerGraph
    14 Declared In
    15 UIBarButtonItem.h

  • 相关阅读:
    云原生范式转变:您准备好了吗?
    CentOS 6.x 开机 自启动 脚本
    忠告 程序员 先思考再编程,累的时候不要写代码
    服务化架构组件清单
    代码自动修复
    选择塑造人生
    mariadb change password
    Spring 集成 Druid Monitor URL 配置转义问题(xml or properties)
    挣钱 vs. 花钱
    管理的要义
  • 原文地址:https://www.cnblogs.com/submarinex/p/2768640.html
Copyright © 2011-2022 走看看