2011-03-15 10 views
4

MonoTouch.Dialog DialogViewController를 사용하여 멋진보기를 만듭니다. 나는에 지정된 것을 다음 다른 백 버튼이 필요가 다음 화면에Monotouch.Dialog - 뒤로 버튼 설정

private RootElement _createRoot(){ 
    return new RootElement ("Buy a Property Report"){ 

      new Section (""){ 
       new StringElement ("View Sample",()=>{ }), 
       new StringElement ("Enter Address",()=>{ }), 
       new StringElement ("Locate This House",() => { }), 
       new StringElement ("My Reports",() => { }) 
      } 
     }; 
} 

이전 "프로퍼티 보고서를 구매" "홈"

에 나는이 작업을 수행.

public override void ViewDidLoad() 
{ 
    base.ViewDidLoad(); 
     this.NavigationController.NavigationBar.TopItem.Title = "Home"; 
} 

대신 Monotouch.Dialog에서이 작업을 수행 할 수있는 방법이 있습니까?

답변

2

나는 당신이 잘 의문을 제기하지만, 대화 컨트롤러에 사용하려고 이해 확실하지 오전 :

this.NavigationItem.BackBarButtonItem.Title = "Home"; 
+2

DVC 수명주기의 어떤 시점에서 당신이해야합니까? 'ViewDidLoad'에서 그렇게하면, BackBarButtonItem은 여전히 ​​null입니다. 'ViewDidAppear'에서 그렇게하면, 'Home'으로 바뀌기 전에 간단히 기본 타이틀을 볼 수 있습니다. – Tyson