在选项卡导航器中设置选项卡下角的圆角半径
使用CSS,我可以在选项卡导航器中设置选项卡顶角的圆角半径:
<mx:Style>
.tabstyle
{
corner-radius: 10;
}
</mx:Style>
<mx:TabNavigator tabStyleName="tabstyle" />
但是,我也希望底角有一个半径。有谁知道该怎么做?
Using CSS, i can set the corner radius of the top corners of a tab in a tabnavigator:
<mx:Style>
.tabstyle
{
corner-radius: 10;
}
</mx:Style>
<mx:TabNavigator tabStyleName="tabstyle" />
However, I also want the bottom corners to have a radius. Does anyone know how to do that??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
假设您放入 TabNavigator 中的项目是标准 Flex 控件集的一部分,您可以让它们使用自定义编程皮肤来绘制其背景/边框以匹配您所需的外观。幸运的是,制作一个程序化皮肤相对容易 获取样式信息(例如角半径值)并使用它来控制图形的绘制方式 - 只需在互联网上浏览一下,您一定会找到Flex 3 中的换肤教程。
Assuming that the items you're putting in the TabNavigator are part of the standard Flex control set, you can have them use a custom programmatic skin that draws their background/border to match your desired look. Luckily, it's relatively easy to make a programmatic skin that grabs style information (like the corner-radius value) and uses that to control how the graphics are drawn -- just poke around the internet, and you're bound to find tutorials on skinning in Flex 3.
ZackBeNimble 的答案效果很好,但实际上我还有一个额外的要求,即任何布局都应该易于更改。所以我现在所做的是将选项卡的皮肤设置为具有我想要的角半径的图像。
The answer by ZackBeNimble worked well, but I actually had the additional requirement that any layout should be easy to change. So what I've done now is set the skin of the tabs to an image that has the corner-radius I want.
扩展@ZackBeNimble 的答案
使用 degrafa:
皮肤组件可能更容易:
您需要填充。另外,skinWidth 和 height 是他们在测试版中添加的 degrafa 内部变量——如果您使用旧版本来获取 unscaledwidth 和 unscaledheight,则必须覆盖 updatedisplaylist。
然后在您要剥皮的组件中,设置以下样式: borderSkin="package.class.location"
如果您不熟悉传统的程序化剥皮,可能会更快一点...我更喜欢 el degrafa。
expanding on the answer from @ZackBeNimble
It might be easier to use degrafa:
skin component:
you'll need a fill. also, skinWidth and height are degrafa internal vars that they added in the beta -- you'll have to override updatedisplaylist if you're using an older version to get the unscaledwidth and unscaledheight.
then in the component you're skinning, set this style: borderSkin="package.class.location"
Might be a bit quicker if you're not familliar with traditional programmatic skinning... i'm more a fan of el degrafa.