2010-10-05 32 views
1

我有這個選項卡,我只想在右上角和左上角四捨五入。但它最終四捨五入。角半徑只適用於特定的角落

我做了什麼:

<mx:TabNavigator id="myTabNav" x="58" y="61" width="584" height="200" creationComplete="setColors(event)" styleName="myTabStyle"> 
    <pages:One label="ThisOne" id="one" name="One"/> 
    <pages:Two label="Twoooooooooooh" id="two" width="584" name="two" /> 
    <pages:Three label="Threeeeeeeeh" id="three" width="583" name="three" /> 
</mx:TabNavigator> 

我pageStyles.css文件是:

.myTabStyle { 
tabStyleName: "myTabs"; 

corner-radius:15; 
} 

.myTabs { 
backgroundColor: #FF0080; 
corner-radius:10; 
focusRoundedCorners: "tl tr"; 
skin:ClassReference('mx.skins.spark.ButtonSkin'); 
chromeColor: #FF0080; /* this is the tab widget itself, not the content */ 
border-style:outset; 
} 

正如你可以看到我有 「focusRoundedCorners」 指向右上方和左上角,但沒有運氣。我得到的是:

我在做什麼錯傢伙?

在此先感謝。

回答

0

所以這裏是解決方案。

你可以寫你自己的按鈕皮膚或使用這裏的一個http://www.wabysabi.com/flex/enhancedbuttonskin/ 名爲EnhancedButtonSkin.as(右鍵單擊,查看源)。 然後聲明您的TabNavigator組件並指定其tabStyleName。

<mx:TabNavigator y="0" height="100%" right="0" left="0" id="navigator" tabStyleName="tab"> 

而現在的CSS:

<fx:Style> 
    .tab 
    { 
    upSkin:ClassReference('com.EnhancedButtonSkin'); 
    overSkin:ClassReference('com.EnhancedButtonSkin'); 
    downSkin:ClassReference('com.EnhancedButtonSkin'); 
    disabledSkin:ClassReference('com.EnhancedButtonSkin'); 
    selectedUpSkin:ClassReference('com.EnhancedButtonSkin'); 
    selectedOverSkin:ClassReference('com.EnhancedButtonSkin'); 
    selectedDownSkin:ClassReference('com.EnhancedButtonSkin'); 
    selectedDisabledSkin:ClassReference('com.EnhancedButtonSkin'); 

    cornerRadii: 5, 5, 0, 0; 
    borderColors: #CC0000, #000000; 
    overBorderColors: #003399, #003399; 
    selectedBorderColors: #666666, #FFFFFF; 
    borderThickness: 1; 
    borderAlpha: 1; 
    fillColors: #CC3300, #F98900; 
    fillAlphas: 1, 1; 
    fillColorRatios: 0, 255; 
    overFillColors: #999999, #FFFFFF; 
    overFillAlphas: 1, 1; 
    overFillColorRatios: 0, 255; 
    selectedFillColors: #999999, #FFFFFF; 
    selectedFillAlphas: 1, 1; 
    selectedFillColorRatios: 111, 255; 
    highlightAlphas: 0, 0; 
    color: #000000; 
    textRollOverColor: #000000; 
    fontSize: 13; 
    } 
</fx:Style> 

這個CSS顯示: