上設置特定角半徑,如果在VBox上設置cornerRadius
,則所有四個角落都會生效。如何將cornerRadius僅應用於左下角和右下角?默認情況下在VBox
0
A
回答
2
試試這個: - 修改上面的代碼是這樣的(代碼由 - user1367714)
<?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" xmlns:local="*">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<local:stackOverflowCornerRadious x="50" y="50" width="200" height="200"/>
</s:Application>
產品類別: - stackOverflowCornerRadious
package
{
import flash.display.Sprite;
import mx.containers.Box;
import mx.containers.VBox;
import mx.utils.GraphicsUtil;
import spark.primitives.Rect;
public class stackOverflowCornerRadious extends VBox
{
public function stackOverflowCornerRadious()
{
super();
}
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
graphics.clear();
graphics.beginFill(0x00FF00);
GraphicsUtil.drawRoundRectComplex(graphics,0,0,unscaledWidth,unscaledHeight,0,0,10,10)
graphics.endFill();
}
}
}
5
延長垂直框部件和如下面提到的updateDisplayList重寫方法: -
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
var cornerRadius:Number = getStyle("cornerRadius");
var backgroundColor:int = getStyle("backgroundColor");
var backgroundAlpha:Number = getStyle("backgroundAlpha");
graphics.clear();
// Background
drawRoundRect(0, 0, unscaledWidth, unscaledHeight,
{tl: 0, tr: 0, bl: cornerRadius, br: cornerRadius},
backgroundColor, backgroundAlpha);
}
+0
謝謝你回答這個問題,它似乎不起作用。而drawRoundRect()有6個參數,這裏有7個參數。 – jason
2
在flex3
,我必須用來代替延伸垂直框的borderskin。但我建議你去flex4(我的意見)。
============================================== ================================
在FLEX4,
你必須使用皮膚類,並且s:Rect有一個屬性,您可以在其中爲所有四個角應用不同的角半徑。
退房此鏈接:
你可以用與使用BorderContainer垂直佈局。
VGroup也有作爲垂直框的,但不支持剝皮。(我的意思是沒有定義skinClass屬性)
<s:VGroup skinClass=""/>----not defined
<s:BorderContainer skinClass="bcSkin"/>----defined, apply custom skin
SO被使用BorderContainer GUD 1與垂直佈局。
感謝
ANKUR
相關問題
- 1. 在默認情況下
- 2. FactoryGirl在默認情況下
- 3. 產量和默認情況||不輸出默認情況下
- 4. 安卓:默認情況下
- 5. 默認情況下,法國
- 6. 默認情況下,Constexpr lambda?
- 7. 默認情況下,在網頁
- 8. 在默認情況下優化CMake
- 9. 複選框在默認情況下knockout.js
- 10. 在默認情況下的UITableViewCell
- 11. 默認情況下在參數
- 12. 的Rails:在默認情況下
- 13. 在wxpython默認情況下隱藏TextCtrl
- 14. 默認情況下,在項目
- 15. 默認情況下,在asp.net MVC2
- 16. 默認情況下修改默認命令:默認命令爲
- 17. 引導3:默認情況下
- 18. 開放的系統,默認情況下
- 19. 默認情況下打開地圖
- 20. 默認情況下python-excel不匹配
- 21. 默認情況下,使qmake使用qt5
- 22. 進口的UIKit默認情況下爲
- 23. 默認情況下,SQL Server表排序
- 24. 默認情況下,mumamo-alt-php-tags-mode
- 25. 發送流切換默認情況下
- 26. 默認情況下「git update-index --assume-unchanged」
- 27. 默認情況下不會執行C++
- 28. 默認情況下返回system.time
- 29. 默認情況下,UITableView編輯模式
- 30. 默認情況下Grails 3 force https
我懷疑你將不得不擴展組件來做到這一點;我不太確定它是如何實施的。如果你使用Flex 4,您可以使用帶有自定義外觀的BorderContainer來完成此操作。 – JeffryHouser