开发者

Tooltip placement setting

My flex app has various Custom components. I want the tooltips for all of them to show at the top-right corner. Is there a Applica开发者_运维百科tion setting that I can do this with? Or do I have to do this at the component level. Either ways, how will it be done?


The ToolTipManager.createToolTip function accepts the position (x and y coordinates) of the tooltip along with the message to display. You'll need to calculate the position of the top-right corner of the components relative to their position within their parent component. For example:

// position the tooltip to the top right of the component
var p:Point = new Point();
p.x = component.x + length;  // may want to add some padding i.e. +5 pixels
p.y = component.y;

// find coordinates in the global coordinate space
p = component.localToGlobal( p );
var tip:IToolTip = ToolTipManager.createToolTip( "tooltip message", p.x, p.y );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜