탑크리에듀
http://www.topcredu.co.kr/
3. XAMARIN.IOS
3.3.5 추가적인 사항
3.3.5 추가적인 사항
• 버튼의 Text 변경 : CallButton의 텍스트를 “Call”로 변경
탑크리에듀 http://www.topcredu.co.kr/
CallButton.SetTitle ("Call", UIControlState.Normal);
• 버튼의 활성화/비활성화
CallButton.Enabled = false;
• 키보드닫기(Dismiss the Keyboard) : 사용자가 Text Field 누르면 iOS는
사용자가 입력 할 수 있도록 키보드를 표시하는데 아쉽게도 키보
드를 닫을 수있는 기본 제공 기능이 없다. 사용자가 CallButton을 누
르면 아래 코드를 TranslateButton에 추가하여 키보드를 닫는다.
PhoneNumberText.ResignFirstResponder ();
3.3.5 추가적인 사항
• URL로 전화걸기 : Apple URL 스키마를 사용하여 시스템 전화 앱을
실행한다. 스키마는 'tel :'접두어와 전화 할 전화 번호로 구성된다
탑크리에듀 http://www.topcredu.co.kr/
var url = new NSUrl ("tel:" + translatedNumber);
if (!UIApplication.SharedApplication.OpenUrl (url))
{
// show alert Controller
}
• 경고(Alert Dialog)창 표시 : 사용자가 시뮬레이터 또는 iPod Touch와
같이 통화를 지원하지 않는 장치에서 전화를 걸려고 할 때 통화를
할 수 없음을 알리는 경고 대화 상자를 표시한다 .
if (!UIApplication.SharedApplication.OpenUrl (url)) {
var alert = UIAlertController.Create ("Not supported", "Scheme 'tel:' is not
supported on this device", UIAlertControllerStyle.Alert);
alert.AddAction (UIAlertAction.Create ("Ok", UIAlertActionStyle.Default, null));
PresentViewController (alert, true, null);
}

[구로자마린학원/자마린강좌/자마린교육]3. xamarin.ios 3.3.5 추가적인 사항

  • 1.
  • 2.
    3.3.5 추가적인 사항 •버튼의 Text 변경 : CallButton의 텍스트를 “Call”로 변경 탑크리에듀 http://www.topcredu.co.kr/ CallButton.SetTitle ("Call", UIControlState.Normal); • 버튼의 활성화/비활성화 CallButton.Enabled = false; • 키보드닫기(Dismiss the Keyboard) : 사용자가 Text Field 누르면 iOS는 사용자가 입력 할 수 있도록 키보드를 표시하는데 아쉽게도 키보 드를 닫을 수있는 기본 제공 기능이 없다. 사용자가 CallButton을 누 르면 아래 코드를 TranslateButton에 추가하여 키보드를 닫는다. PhoneNumberText.ResignFirstResponder ();
  • 3.
    3.3.5 추가적인 사항 •URL로 전화걸기 : Apple URL 스키마를 사용하여 시스템 전화 앱을 실행한다. 스키마는 'tel :'접두어와 전화 할 전화 번호로 구성된다 탑크리에듀 http://www.topcredu.co.kr/ var url = new NSUrl ("tel:" + translatedNumber); if (!UIApplication.SharedApplication.OpenUrl (url)) { // show alert Controller } • 경고(Alert Dialog)창 표시 : 사용자가 시뮬레이터 또는 iPod Touch와 같이 통화를 지원하지 않는 장치에서 전화를 걸려고 할 때 통화를 할 수 없음을 알리는 경고 대화 상자를 표시한다 . if (!UIApplication.SharedApplication.OpenUrl (url)) { var alert = UIAlertController.Create ("Not supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert); alert.AddAction (UIAlertAction.Create ("Ok", UIAlertActionStyle.Default, null)); PresentViewController (alert, true, null); }