FLEX 4常用設置背景圖片的方法

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

               xmlns:s="library://ns.adobe.com/flex/spark" 

               xmlns:mx="library://ns.adobe.com/flex/mx" 

               minWidth="955" minHeight="600">

    <s:BorderContainer width="100%" height="100%" backgroundImage="@Embed(source='assets/untitled.png')">

        //內容

    </s:BorderContainer> 

</s:Application>


註釋:圖片不能用絕對路徑,一般用@Embed(source='圖片路徑)"

 <s:BorderContainer width="100%" height="100%" backgroundImage="@Embed(source='assets/untitled.png')">中

source後的是文件路徑,flex中路徑的起始位置是src目錄,加 ../就是到src的上一層

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章