接下来的例子演示了Flex中如何通过titleStyleName和textIndent样式,设置Panel的标题。
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:Style>
- .myPanelTitle {
- textIndent: 50;
- }
- </mx:Style>
- <mx:Panel title="Lorem ipsum"
- titleStyleName="myPanelTitle"
- titleIcon="@Embed('assets/accept.png')"
- width="200">
- <mx:Text text="The quick brown fox jumped over the lazy dog."
- width="100%" />
- </mx:Panel>
- </mx:Application>