【问题标题】:How to Click/ Press Bar Button on Navigation Item programmatically如何以编程方式单击/按下导航项上的条形按钮
【发布时间】:2013-01-10 08:06:27
【问题描述】:

我的 iPhone 如下。

我想要的是在单击Delete 按钮时单击Refresh 按钮**以编程方式**。

注意:我也为Refresh按钮提供了标签。

【问题讨论】:

  • 为什么不使用 uibutton 初始化 rightbarbutton 项目并在单击时执行选择器?你可以随时调用它的方法

标签: iphone objective-c ios6 uibutton uibarbuttonitem


【解决方案1】:

我假设你有delete and refresh actions

 -(IBAction)deleteAction:(id)sender 
 -(IBAction)refreshAction:(id)sender:

现在delete action call refresh action 就像这样:

-(IBAction)deleteAction:(id)sender
{
    [self refreshAction:btnRefresh]; //provide refresh action along with refersh button
    //I mean here act according to refresh method.
}

【讨论】:

  • 我相信同一个按钮不能有动作和属性both..所以我不能给刷新按钮命名为btnRefresh
  • 我没有得到评论中写的内容。
  • 什么是btnRefresh。它是连接到刷新按钮的属性吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-06
  • 1970-01-01
  • 2013-10-09
  • 1970-01-01
  • 2021-09-30
  • 1970-01-01
  • 2013-10-14
相关资源
最近更新 更多