0
我需要根據Youtube的最新用戶界面創建標籤式菜單,並在Android和iOS上顯示頂部的菜單。將標籤移至Xamarin頂部時刪除底部的空白空間.iOS
Android上的默認行爲是在頂部顯示菜單,因此工作正常。
在iOS上我創建了一個自定義的渲染,我使用下面的代碼來改變棒的頂端位置:
UIInterfaceOrientation orientation = UIApplication.SharedApplication.StatusBarOrientation;
if (UIInterfaceOrientation.LandscapeLeft == orientation || UIInterfaceOrientation.LandscapeRight == orientation)
{
tabSize = 32.0f;
}
CGRect tabFrame = this.TabBar.Frame;
tabFrame.Height = tabSize;
tabFrame.Y = this.View.Frame.Y;
this.TabBar.Frame = tabFrame;
this.TabBar.ContentMode = UIViewContentMode.ScaleToFill;
// Set the translucent property to NO then back to YES to
// force the UITabBar to reblur, otherwise part of the
// new frame will be completely transparent if we rotate
// from a landscape orientation to a portrait orientation.
this.TabBar.Translucent = false;
this.TabBar.Translucent = true;
//this.TabBar.Translucent = false;
this.TabBar.SetNeedsUpdateConstraints();
我的問題是,有在底部一些空白來補償對於已經移動到頂部的酒吧。
有沒有人知道如何解決這個問題?
此問題也在以下文章中,但我無法找到答案。 https://forums.xamarin.com/discussion/comment/226114/#Comment_226114
這沒關係。但實際上標籤欄不會在標題中。請參閱YouTube應用。 在這種情況下,頂部有不必要的空白。 – Hetal
@HetalJariwala我不明白,你能附上圖像來描述你面臨什麼問題嗎? –
@HetalJariwala你看到我的測試gif嗎? –