2011-03-26 109 views
0

我正在尋找一個解決方案,我如何顯示UIBarButtonItem被按下。所以我可以顯示用戶是否按下了某個按鈕?UIBarButtonItem。如果按鈕被按下,如何顯示切換狀態?

所以我想要顯示用戶是否按下了「找到我」按鈕。

一些想法,我可以做到這一點?

+0

確實是什麼意思。你想保持按鈕處於按下狀態,還是想顯示其他地方該按鈕被按下? – thvanarkel 2011-03-26 15:30:56

回答

3

下面是我做到的!

- (IBAction) displayPoiMarkers { 

    if (displayPoiStatus) { // remove the markers 

     // Button style change.. looks not pressed 
     displayPoiButton.style = UIBarButtonItemStyleBordered; 

    } else { // display the markers 

     // Button style change.. looks pressed 
     displayPoiButton.style = UIBarButtonItemStyleDone; 
    } 

}