Flex TextInput 控件:搜索样式渲染
我有一个 TextInput 控件,它具有系统中人员的搜索功能。 效果很好。 我所需要的只是将其样式设置为右侧有搜索图像,单击该图像时将进行搜索。 它实际上是应用程序的外观和感觉的一部分,这将使搜索框看起来更好。
这与 Firefox 中嵌入的搜索框中实现的行为完全相同。
有什么办法解决这个问题吗?
谢谢 :)
I have a TextInput control which has a search functionality for the people in the system.
It works fine. All I need is to style it in such a way that, it will be having search image on the right, which when clicked, will search. Its actually for look and feel part of the application, which will make the search box look much better.
It is exactly similar behavior implemented in search box embedded in Firefox.
Any solution to this?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
确认,避免子类化。 可以说,跳出框框思考,并使用画布:
如果您想让它更整洁,那么就将其本身作为一个组件。 与其他地方一样,在 MXML 中更倾向于组合而不是继承。
Ack, avoid subclassing. Think outside the Box, as it were, and use a Canvas:
Then make that a component itself if you want to make it neater. Favour composition over inheritance, in MXML as elsewhere.
就这样!
That's all!
您可以编写 TextInput 类的子类,其中包含“yourSearchIcon”图像的图像,例如:
显然您必须处理调整大小事件
这是您的自定义组件
You could write a subclass of TextInput Class which has as an image for "yourSearchIcon" image such as:
obviously you have to handle the resize event
That's your custom component
希望这段代码对您有帮助。 此代码在
TextInput
左侧添加一个搜索图标。Hope this code will help you. This code adds a search icon to the left of the
TextInput
.