2010-05-24 70 views
1

我知道後續會顯示一個手形光標:如何在鼠標移出時顯示手形光標List組件?

component.mouseChildren = true; 
component.useHandCursor = true; 
component.buttonMode = true; 

當我做了以上的List組件,手按鈕顯示,整個組件失去它的交互性(手形光標顯示即使在滾動條)。

那麼如何在滾動列表項時顯示手形光標只有

回答

6

想念你的完整測試,下面是如何在任何Flex控件上顯示手形光標。

我會建議你做一個定義ItemRenderer併爲每個使用這些控件的渲染器,這將使它只顯示當你過的itemRenderer,它將不適用於整個列表控制...


看看這個博客文章我寫了關於在任何Flex控件上顯示手形光標的信息。

Showing hand cursor on any Flex Control

有時useHandCursor=true buttonMode=true是足夠了,但對於某些控件,你必須使用mouseChildren=false

例子:

<mx:Button label="Button" useHandCursor="true" buttonMode="true" /> 

<mx:Label text="Label" useHandCursor="true" buttonMode="true" mouseChildren="false"/> 
+0

添加自定義渲染器似乎是要走的路。 – Yeti 2010-05-24 17:27:07

1

我有同樣的問題與得到一個手形光標在數據網格。我認爲這個解決方案對列表來說是一樣的。

我發現拿到手形光標同時也有與我的數據網格項目的互動是使用DataGrid的爲itemRollOver和爲itemRollOut事件(列表中包含了他們太多)的方式:

[Embed("../assets/images/cursors/hand_cursor.png")] 
private var handCursor:Class; 

protected function grid_itemRollOver():void { 
    cursorManager.setCursor(handCursor); 
} 

protected function grid_itemRollOut():void { 
    cursorManager.removeAllCursors(); 
} 
0
function meOver(evt:Event):void{ 
    evt.target.useHandCursor = true; 
} 

myList.addEventListener(MouseEvent.MOUSE_OVER, meOver); 
相關問題