【问题标题】:Make one button enable a different button使一个按钮启用另一个按钮
【发布时间】:2013-05-16 10:21:37
【问题描述】:

我有 4 个自定义单选按钮,单击时会更改消息。该消息处理搜索词。我有一个搜索按钮。有谁知道一种方法可以使搜索按钮激活不同的操作以根据单击的单选按钮将您带到不同的页面?

有点像让一个搜索按钮连接到 4 个不同的操作,并通过单选按钮启用/禁用这些操作。

如果有人知道如何只用 2 个按钮做到这一点,那么我可以弄清楚 4 个按钮的逻辑。

【问题讨论】:

    标签: cocoa button


    【解决方案1】:

    这是我的新工作代码:

    //搜索按钮

    -(IBAction)showWineriesButton
    {
        btnSearchWineries.hidden=FALSE;
        btnSearchGrapes.hidden=TRUE;
        btnSearchWines.hidden=TRUE;
        btnSearchReviews.hidden=TRUE;
    
    }
    
    -(IBAction)showGrapesButton
    {
        btnSearchWineries.hidden=TRUE;
        btnSearchGrapes.hidden=FALSE;
        btnSearchWines.hidden=TRUE;
        btnSearchReviews.hidden=TRUE;
    
    }
    
    -(IBAction)showWinesButton
    {
        btnSearchWineries.hidden=TRUE;
        btnSearchGrapes.hidden=TRUE;
        btnSearchWines.hidden=FALSE;
        btnSearchReviews.hidden=TRUE;
    
    }
    
    -(IBAction)showReviewsButton
    {
        btnSearchWineries.hidden=TRUE;
        btnSearchGrapes.hidden=TRUE;
        btnSearchWines.hidden=TRUE;
        btnSearchReviews.hidden=FALSE;
    
    }˚
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-01
      • 1970-01-01
      • 2021-12-18
      • 1970-01-01
      • 1970-01-01
      • 2021-10-08
      • 2019-05-03
      • 2021-07-18
      相关资源
      最近更新 更多