내 애플리케이션 페이지를 iOS 상태 표시 줄 아래에 배치하려면 내 페이지에 대한 맞춤 렌더러를 만들었습니다. 할 것 바로 다음 XAML처럼 표시 줄 아래에있는 페이지를 이동하도록되어 : iOS의 상태 표시 줄 아래로 맞춤 렌더링 페이지 이동
<local:CustomRenderedPage.Padding>
<OnPlatform x:TypeArguments="Thickness">
<OnPlatform.iOS>
0, 40, 0, 0
</OnPlatform.iOS>
</OnPlatform>
</local:CustomRenderedPage.Padding>
그러므로 내가 C 번호로 변환 한
this 대답을 사용했다.
그러나 오류없이 상태 표시 줄 뒤에 페이지가 계속 표시됩니다. 사용자 지정 렌더러가 작동하는지 확인하려면 작동중인 배경색도 변경하고 있습니다.
//manually adjust the frame of the main view to prevent it from appearing under the status bar.
var app = UIApplication.SharedApplication;
if (!app.StatusBarHidden)
{
this.View.BackgroundColor = UIKit.UIColor.FromRGB(20, 100, 20); //works
this.View.Frame = new CoreGraphics.CGRect(0.0, app.StatusBarFrame.Size.Height, this.View.Bounds.Size.Width, this.View.Bounds.Size.Height - app.StatusBarFrame.Size.Height); // does not work
}
Log.WriteLine("Done"); // works
내가 뭔가 잘못하고
암, 또는 왜이 작동하지 않습니다? 당신이에서이 코드를 호출하고 "내 사용자 지정 페이지 렌더러 내부에서"대답 WHERE 내가 전에 질문이기 때문에
그게해야 할 일입니다. – cocoseis
귀하의 경우에 "이것이"무엇입니까? 그리고 어디에서이 코드를 호출할까요? –
페이지를 아래로 이동하고 싶습니다. 내 사용자 지정 페이지 렌더러 내부에서이를 호출합니다. – cocoseis