文件上传控件和GWT外观 [英] File Upload Control and GWT Look and Feel

查看:194
本文介绍了文件上传控件和GWT外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写我的第一个GWT项目。我有一个表单与标签,文件上传控制和上传按钮,但他们看起来很糟糕,在各种网络浏览器太不同。另外,按钮从文件上传控件没有相同的风格,如GWT按钮控件。另一个问题是,在Chrome按钮文件选择在左边?!?



我能做什么?



Internet Explorer 中上传文件:





Firefox 中上传文件:





Chrome 中上传文件:



解决方案

< input type =file> 在不同的浏览器中看起来会有所不同。这是他们和我们一起生活的方式。



但我不认为这是真正的担心。如果有人选择使用浏览器,他们决定使用浏览器的外观和感觉,包括< input type =file>的渲染。 / p>

也不可能更改此控件的按钮样式(以体面/干净的方式)。



在我看来,你可以留下他们的方式。对我来说,< input type =file> 是某种由系统(浏览器)拥有的系统控制,不是程序员。您不能决定要显示哪些文件以及哪些文件不能显示(例如,过滤和显示.doc和.docx,其他不可能)



如果由于某种原因,你真的真的需要一个统一的界面:一些网站使用按钮的图片,并使用闪光灯来显示文件打开框。这依赖于闪存的存在。我记得(2岁的内存)有一个控制在YUI这种文件输入(基于闪存),也许有一个类似的GWT。我不太确定。


I'm writing my first GWT project. I have a form with label, file upload control and upload button but they look awful and too different in various web browsers. Also button from file upload control doesn't have the same style like GWT button control. And the other problem is that in Chrome Button for file choose is on the left?!?

What I can do about it?

File Upload in Internet Explorer:

File Upload in Firefox:

File Upload in Chrome:

解决方案

The <input type="file"> WILL look different in different browsers. This is the way they and we have to live with it.

But I don't think this is something to really worry about. If someone chooses to work with a browser, they decide the work with the browser's look and feel, which includes the rendering of <input type="file">.

It is also not possible to change the button styles of this control (in a decent/clean manner).

In my opinion you can leave them the way they are. For me the <input type="file"> is some sort of a system control owned by the system (the browser), and not the programmer. You cannot also decide which files to display and what not to (eg., filter and display ".doc" and ".docx" and nothing else is not possible)

If for some reason you really really need a single uniform interface: some websites use a picture of a button and use flash to display the file open box. This relies on the presence of flash though. I remember (2 years old memory) there was a control in YUI for this kind of file input (based on flash), perhaps there is a similar one in GWT. I am not very sure though.

这篇关于文件上传控件和GWT外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆