如何从 TextInput 中删除阴影?
我的 Flex 应用程序中有一个样式表,引用为:
<mx:Style source="/assets/stylesheets/default.css" />
在此样式表中,我全局地将 dropShadowEnabled 设置为 true:
global {
fontSize: 11pt;
dropShadowEnabled: true;
verticalAlign: "middle";
}
这为许多组件(包括所有 TextInput)提供了阴影。
但是,我有一个显示可编辑组合框的标题窗口组件,并且我不希望该文本输入有阴影。 然而我无法让它消失。 我尝试过以下操作:
创建 CSS 类选择器...
<mx:ComboBox editable="true" dataProvider="{nameOptions}" textInputStyleName="noDropShadow" />
...在默认 CSS 中:
.noDropShadow {
dropShadowEnabled: false;
}
...在标题窗口中:
<mx:Style>
.noDropShadow {
dropShadowEnabled: false;
}
</mx:Style>
...还有:
<mx:Style>
TextInput.noDropShadow {
dropShadowEnabled: false;
}
</mx:Style>
这些都没有删除投影。 我在这里缺少什么?
I have a style sheet in my Flex Application, referenced as:
<mx:Style source="/assets/stylesheets/default.css" />
In this style sheet, I set dropShadowEnabled to true gloablly:
global {
fontSize: 11pt;
dropShadowEnabled: true;
verticalAlign: "middle";
}
This gives a drop shadow to many components, including all TextInputs.
However, I have a Title Window component that displays an editable ComboBox and I don't want that Text Input to have a drop shadow. I can't get it to go away however. I've tried the following:
Creating a CSS class selector...
<mx:ComboBox editable="true" dataProvider="{nameOptions}" textInputStyleName="noDropShadow" />
...in the default CSS:
.noDropShadow {
dropShadowEnabled: false;
}
...in the Title Window:
<mx:Style>
.noDropShadow {
dropShadowEnabled: false;
}
</mx:Style>
...also:
<mx:Style>
TextInput.noDropShadow {
dropShadowEnabled: false;
}
</mx:Style>
None of these removed the drop shadow. What am I missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种解决方案是删除“dropShadowEnabled: true;” 从全局样式中选择并仅将其放在您特别想要阴影的项目上。
One solution would be to remove "dropShadowEnabled: true;" from the global style and put it only on the items you specifically want drop shadow.
为您的组合框指定 id 属性,然后:
combo_box_id.setStyle( "dropShadowEnabled", false );
在您的
块中。Give your combo-box an id attribute and then:
combo_box_id.setStyle( "dropShadowEnabled", false );
In your
<mx:Script/>
block.