加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex 容器填充渐变的背景颜色

发布时间:2020-12-15 05:03:01 所属栏目:百科 来源:网络整理
导读:今天学习的时候,要给一个vbox填充渐变的背景颜色,效果如图所示: ? ? 但是查属性发现只有backgroundColor 连backgroundImage都没有? 我用的是spark主题,sdk4.5.1,mx:VBox实现不来效果,几经后找到了解决办法: 就是在mxml文件中的VBox里面直接做一个Grou

今天学习的时候,要给一个vbox填充渐变的背景颜色,效果如图所示:

?

?

但是查属性发现只有backgroundColor 连backgroundImage都没有? 我用的是spark主题,sdk4.5.1,<mx:VBox>实现不来效果,几经后找到了解决办法:

就是在mxml文件中的VBox里面直接做一个Group,然后里面做填充颜色,就像些皮肤一样。- -代码如下

?

 
 
  1. <?xml?version="1.0"?encoding="utf-8"?>?
  2. <mx:Application?xmlns:fx="http://ns.adobe.com/mxml/2009"? ?
  3. ????????????????????xmlns:s="library://ns.adobe.com/flex/spark"? ?
  4. ????????????????????xmlns:mx="library://ns.adobe.com/flex/mx"?xmlns:logic="com.runqianapp.fastreport.view.logic.*"?
  5. ????????????????????width="100%"?height="100%"?fontFamily="宋体"?>?
  6. ????<fx:Declarations>?
  7. ????????<!--?将非可视元素(例如服务、值对象)放在此处?-->?
  8. ????</fx:Declarations>?
  9. ????<mx:VBox?verticalGap="0"?width="100%"?height="100%"?>?
  10. ????????<mx:HRule?strokeWidth="1"?strokeColor="#CFD9F5"?width="100%"/>?
  11. ????????<mx:HRule?strokeWidth="1"?strokeColor="#DCE4F7"?width="100%"/>?
  12. ????????<mx:HRule?strokeWidth="1"?strokeColor="#EBEFFB"?width="100%"/>?
  13. ????????<mx:HRule?strokeWidth="1"?strokeColor="#F8F9FE"?width="100%"/>?
  14. ????????<s:Group?height="100"?width="500">?
  15. ????????????<s:Rect?width="100"?height="100">?
  16. ????????????????<s:fill>?
  17. ????????????????????<s:LinearGradient?rotation="90">?
  18. ????????????????????????<s:GradientEntry?color="#F8F9FE"?alpha="1.0"/>?
  19. ????????????????????????<s:GradientEntry?color="#CFD9F5"?alpha="1.0"?/>?
  20. ????????????????????</s:LinearGradient>?
  21. ????????????????</s:fill>?
  22. ????????????</s:Rect>?
  23. ????????????<s:Button?label="123"/>?
  24. ????????</s:Group>?????????? ?
  25. ????????<mx:HRule?strokeWidth="1"?strokeColor="#D7E3F5"?width="100%"/>?
  26. ????????<mx:HRule?strokeWidth="1"?strokeColor="#D0DBF4"?width="100%"/>?
  27. ????????<mx:HRule?strokeWidth="1"?strokeColor="#C9D5F2"?width="100%"/>?
  28. ????????<mx:HRule?strokeWidth="1"?strokeColor="#C5D1F2"?width="100%"/>?
  29. ????????<mx:HRule?strokeWidth="1"?strokeColor="#A5B8EA"?width="100%"/>?
  30. ????</mx:VBox>?? ?
  31. </mx:Application>?

学习ING。。~~

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读