滚动条问题
我想在 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.
Please Help me...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要创建自定义 ThumbSkin 类。
然后,将其指定为 CSS 中的 classReference。
要了解如何创建这些自定义外观,请阅读这两个 Adobe 文档。
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.