2013-06-18 2 views
0

모노 터치 대화보기 컨트롤러가 있습니다. 나는 중첩 된 루트 요소의 수대화 상자보기 컨트롤러 내에서 BackButton 텍스트 업데이트

 public RootElement LoginSection() 
    { 
     //var rootSection = new Section(""); 
     var root = new RootElement ("I'm already a member"); 

     EntryElement emailEnt = new EntryElement ("Login","Username or Email",""); 
     EntryElement passwdEnt = new EntryElement ("Password","Password","",true); 

     StyledStringElement loginBtn = new StyledStringElement ("Login"){ 
      Accessory = UITableViewCellAccessory.DetailDisclosureButton 
     }; 
     Section loginDetails = new Section("Your Details"){emailEnt,passwdEnt,loginBtn}; 
     loginBtn.Tapped +=() => { 
      var result = ApiOperations.ApiValidateLoginCredentials (emailEnt.Value, passwdEnt.Value); 
      if (result) { 
       var login = DataOperations.DbGetLogin(); 
       //first time user so we need to save their details into the db 
       if (login == null) { 

       } else { 
        BTProgressHUD.Show ("Logging In", -1, BTProgressHUD.MaskType.Black); 
        BTProgressHUD.InvokeInBackground (delegate { 
         ApiOperations.QrCode (login.ConsumerId); 
         ApiOperations.ApiConsumer (login.ConsumerId); 
         AuthenicatedActionCompleted.Invoke (this, new EventArgs()); 
         BTProgressHUD.Dismiss(); 
        }); 
       } 
      } else { 
       //didnt work 
       using (var alert = new UIAlertView ("Unable to login", "Please try again.", null, "OK", null)) 
        alert.Show(); 
      } 
     }; 
     root.Add (loginDetails); 
     return root; 
     } 

내 문제는이 요소 제목의 각각의 길이 있습니다. 내 최상위 루트 제목도 예 :

나는 뒤로 버튼 위의 rootelement에 탭하면 내 응용 프로그램

에 오신 것을 환영합니다 "에 오신 것을 환영합니다 ...."이 표시 이상적으로 나는 긴 문자열 대 "뒤로"보여 버튼을하고 싶습니다.

업데이트가 가능합니까?

답변

1

좋아요. 다른 누군가가 똑같은 문제를 겪고 있다면 나에게 도움이된다.

마지막 줄이 트릭입니다.

public override void LoadView() 
    { 
     base.LoadView(); 
     View.BackgroundColor =UIColor.Clear; 
     TableView.BackgroundView = null; 
     var background = UIImage.FromBundle(Resources.BackgroundImagePath); 
     ParentViewController.View.BackgroundColor = UIColor.FromPatternImage (background); 
     this.NavigationItem.BackBarButtonItem = new UIBarButtonItem ("Back", UIBarButtonItemStyle.Plain, null); 
    } 
관련 문제