在Spark文本区域中设置图像样式

3

这个示例展示了如何在你的Spark文本区域中添加图片并设置其float属性以及paddingLeft/paddingRight属性:

<s:RichEditableText id="myRET1" width="300">
    <s:textFlow>
        <s:TextFlow columnWidth="290">
            <s:p id="p1">Images in a flow are a good thing. For example, here is a float. 
            <s:img id="image1" float="none" source="@Embed(source='../assets/bulldog.jpg')" paddingRight="10" paddingTop="10" paddingBottom="10" paddingLeft="10">
            </s:img>
            Don't you agree? It should show on the left. If it doesn't show up on the left, then it is a bug. You can submit bugs at http://bugs.adobe.com/jira/. You can set how the float is positioned within
            the paragraph by using the ComboBox below. You can select left, right, start, end, or none. This example does not use the clearFloats property. That is in a different example.</s:p>
        </s:TextFlow>
    </s:textFlow>
</s:RichEditableText>   

是否可以通过Flex的CSS来指定图像的浮动/填充?

1个回答

0

是的,可以通过CSS指定图像:

1)创建一个包含此图像和这些属性(填充)的皮肤

2)创建一个包含组件名称空间并调用类引用的CSS文件(将类作为参数传递给皮肤)

3)在mxml文件中定义样式名称,等于步骤1中指定的名称空间


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接