如何在Flex 4中的TextInput组件上获得圆角半径.
<s:TextInput prompt="username" width="150" maxChars="100" id="txt_username"
color="#000000"/>
Run Code Online (Sandbox Code Playgroud)
RIA*_*tar 10
创建自定义外观(可能通过复制spark TextInputSkin)并添加带圆角的边框图形,如下所示:
<!-- border -->
<s:Rect id="border" left="0" right="0" top="0" bottom="0"
radiusX="10" radiusY="10">
<s:stroke>
<s:SolidColorStroke id="borderStroke" weight="1" />
</s:stroke>
</s:Rect>
Run Code Online (Sandbox Code Playgroud)
如果您想要更多特殊的圆角,您还可以使用以下属性:
topLeftRadiusX="4" topLeftRadiusY="8"
bottomLeftRadiusX="2" bottomRightRadiusY="10"
Run Code Online (Sandbox Code Playgroud)
默认的TextInputSkin不允许使用圆角,因此您无法在TextInput上设置样式来执行此操作.所以,不,除了创建自定义皮肤类之外别无他法.
| 归档时间: |
|
| 查看次数: |
6122 次 |
| 最近记录: |