2012-06-04 4 views
2

내 슬라이더의 값이 변경되면 UIBarButton의 식별자를 변경하고 싶습니다. 나는 그 방법으로 그것을 시도했다 :런타임시 UIBarButton 식별자 변경

var button = new UIBarButtonItem(UIBarButtonSystemItem.Save); 
this.Pad_btnClose = null; 
this.Pad_btnClose = button; 

그러나 doesnt 일. 나는 또한 그 방법을 시도 :

this.Pad_btnClose = new UIBarButtonItem(UIBarButtonSystemItem.Save); 

도 작동하지 않습니다.

답변

3

변수 또는 콘센트를 설정하면 화면에서 UIBarButtonItem이 제거되지 않습니다.

yourToolbar.Items = new UIBarButtonItem[] { yourNewButtonItem }; 

을 또는 당신이 원하는 경우는 애니메이션 :

그렇게하기 위해서는, 당신은 UIToolbar에 대한 출구를 만들어야에서, 다음 전화

yourToolbar.SetItems(new UIBarButtonItem[] { yourNewButtonItem }, true); 

이 목록을 덮어 쓰게됩니다 버튼 항목을 클릭합니다.