2016-02-22 41 views

回答

2

我認爲這是不可能在共同的方式在所有平臺上做的,你必須做在特定平臺的方式。

對於Android項目我做它以這樣一種方式: 在文件Styles.xml從文件夾資源/值我加風格

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="CustomTheme" 
      parent="@android:style/Theme.Holo"> 
     <item name="android:actionBarTabTextStyle">@style/CustomTab</item> 
    </style> 

    <style name="CustomTab" 
      parent="@android:style/Widget.Holo.ActionBar.TabText"> 
     <item name="android:gravity">center</item> 
    </style> 
</resources> 

而在MainActivity.cs我加入

[Activity(Theme = "@style/CustomTheme")] 

對於Windows手機我發現這篇文章https://nocture.dk/2014/12/10/xamarin-forms-customizing-tabbed-page-header-title-windows-phone/,但沒有嘗試它。

對於iOS我沒有檢查太http://jfarrell.net/2015/02/25/customizing-the-tab-bar-on-ios-with-xamarin-forms/

+0

這裏唯一的問題是當你已經有一個以前的主題集。 –