문제

뷰를 수동으로 인스턴스화하려고 했는데 검은 화면만 나타납니다.

내 FinishedLoading의 핵심은 다음과 같습니다.

currentController = new ChoicesScreen(this.window.Handle);
window.AddSubview (currentController.View);
window.MakeKeyAndVisible();

메모:CurrentController는 protected UIViewController currentController

ChoicesScreen은 IB에 정의되어 있으며 적절한 콘센트, 작업 등이 있습니다.즉, 그것은 유효한 견해입니다.

ChoicesScreen의 기본 생성자를 사용해 보았지만 동일한 결과를 얻었습니다.분명히 내 화면을 표시하는 방법에 뭔가 빠졌습니다.

도움이 되었습니까?

해결책

드리스,

보기에 표시할 위치를 정의하려면 새 보기의 프레임을 설정해야 합니다.

currentController = new ChoicesScreen(this.window.Handle);
currentController.View.Frame = new System.Drawing.RectangleF(0, 0, 320, 480);
window.AddSubview (currentController.View);
window.MakeKeyAndVisible();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top