简体   繁体   English

在元素中使用徽章来灵活移动

[英]flex mobile using badges in elements

Is there a way to display so called badges in Flex elements? 有没有办法在Flex元素中显示所谓的徽章?

With badges I mean the little red circles with a number in it which are used to display the amount of new items in a inbox by example. 带有徽章的意思是带有数字的红色小圆圈,用于举例显示收件箱中的新物品数量。

I want to display badges in a flex list or tabbed item. 我想在弹性列表或选项卡式项目中显示徽章。

Is this core functionality of Flex? 这是Flex的核心功能吗?

You can definitely do this in Flex, but it will likely (without seeing your designs, etc) require implementing a custom item renderer for the list. 您绝对可以在Flex中执行此操作,但可能(无需查看设计等)就需要为列表实现自定义项目渲染器。 For an example of doing this for a Flex-based web or AIR app, look here . 有关针对基于Flex的Web或AIR应用程序执行此操作的示例,请参见此处 Also, you will likely want to read up on Flex 4 skinning for writing a custom skin for your list item renderers, as well as perhaps the list itself. 另外,您可能需要阅读Flex 4 外观,以便为列表项呈示器以及列表本身编写自定义外观。 Additionally, if you are, as implied by your tags, writing a flex mobile app, you'll want to read up on building mobile item renderers as they differ in subtle, but important ways from standard web-based Flex or desktop AIR apps. 此外,如果您(如代码所暗示的那样)编写了一个Flex移动应用程序,则您将需要阅读构建移动项目呈示器的内容,因为它们与基于标准的基于Web的Flex或桌面AIR应用程序有细微但重要的区别。

The short answer, then, is yes, but you will likely need to write some custom code to get things exactly the way you want them, styling-wise and behaviorally. 简短的答案是肯定的,但是您可能需要编写一些自定义代码,才能以样式和行为方式完全按照所需的方式获取内容。

How did you do? 你怎么做的? I use the next snippet for a badge in a tabbed item. 我将下一个代码片段用于选项卡式项目中的徽章。 http://blog.aboutme.be/2011/10/28/flex-mobile-tabbed-view-navigator-button-badge/ http://blog.aboutme.be/2011/10/28/flex-mobile-tabbed-view-navigator-button-badge/

I hope it helps you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM