[英]How to change Xamarin.Forms Tab Bar height (iOS)
如何在Xamarin.Forms(iOS)中更改Tab欄的高度? TabbedRenderer可以嗎?
是的,可以從CustomRenderer
修改。
您需要在Forms項目中TabbedPage
並使用此類導出渲染。
然后在CustomRenderer中覆蓋ViewWillLayoutSubviews
方法。 就像是:
public class MyTabbedPageRenderer : TabbedRenderer
{
// Modify this variable with the height you desire.
private readonly float tabBarHeight = 55f;
public override void ViewWillLayoutSubviews()
{
base.ViewWillLayoutSubviews();
TabBar.Frame = new CGRect(TabBar.Frame.X, TabBar.Frame.Y + (TabBar.Frame.Height - tabBarHeight), TabBar.Frame.Width, tabBarHeight);
}
}
希望這可以幫助。-
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.