滚动条问题

发布于 2024-12-29 00:19:30 字数 844 浏览 8 评论 0原文

我想在 FLEX 3.0 应用程序中创建自定义滚动条。这应该能够使用文本而不是||||在 ScrollThumb 中显示...

我已经使用 mx_internal 来更改其样式,但仍然面临文本不显示的问题。这是我创建的代码。

import mx.core.mx_internal;

use namespace mx_internal;

public function onInit():void
{
    scrollbar.scrollThumb.iconName = "";
    scrollbar.scrollThumb.labelPlacement = "left";
    var str:String = (scrollbar.scrollPosition+1).toString() + "/" + (scrollbar.maxScrollPosition+1).toString();
    scrollbar.scrollThumb.label = str;
}

<mx:HScrollBar id="scrollbar" width="100%" pageSize="1" styleName="customScrollBar" />

这是该样式表

.customScrollBar
{
    up-arrow-skin: ClassReference(null);
    down-arrow-skin: ClassReference(null);
}

,我为您提供了我想要创建的滚动条的示例图像。

在此处输入图像描述

请帮助我...

I want to create a Custom Scroll bar in my FLEX 3.0 application. Which should enable to use Text instead of |||| that shows in ScrollThumb...

I have used mx_internal for changing the style of that but still facing the problem that text is not displayed. here is the code that i have created.

import mx.core.mx_internal;

use namespace mx_internal;

public function onInit():void
{
    scrollbar.scrollThumb.iconName = "";
    scrollbar.scrollThumb.labelPlacement = "left";
    var str:String = (scrollbar.scrollPosition+1).toString() + "/" + (scrollbar.maxScrollPosition+1).toString();
    scrollbar.scrollThumb.label = str;
}

<mx:HScrollBar id="scrollbar" width="100%" pageSize="1" styleName="customScrollBar" />

Here is the stylesheet for that

.customScrollBar
{
    up-arrow-skin: ClassReference(null);
    down-arrow-skin: ClassReference(null);
}

Here I am giving you the sample image that kind of scroll bar i want to create.

enter image description here

Please Help me...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

影子是时光的心 2025-01-05 00:19:30

您需要创建自定义 ThumbSkin 类。

然后,将其指定为 CSS 中的 classReference。

要了解如何创建这些自定义外观,请阅读这两个 Adob​​e 文档。

http://livedocs.adobe.com/flex/3 /html/help.html?content=skinning_7.html

http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_5.html

要将分页数据放入滚动条中,您必须计算在主上下文上分页数据,然后将分页信息作为字符串传递到带有标签的拇指皮肤。滚动条和拇指本身将无法知道它在多少页上,或者正在显示多少个项目。但是,如果您想要百分比,可以在滚动条中完成。

You need to create a custom ThumbSkin Class.

Then, assign that as a classReference in the CSS.

To learn how to create these custom skins, read these two Adobe documents.

http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_7.html

http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_5.html

To get the paging data into the scrollbar, you will have to calculate the paging data on the main context, and then just pass in the paging info as a String to the thumbskin with a label. The scroller and thumb itself will not be able to know how many pages it is on, or how many items are being displayed. However, if you wanted a percerntage, that could be done in the scroller.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文