PhoneGap& Android - 如何使用新的选择列表样式 [英] PhoneGap & Android - How to use the new select list style

查看:103
本文介绍了PhoneGap& Android - 如何使用新的选择列表样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PhoneGap开发了Android移动应用。

I developed an mobile app for Android using PhoneGap. I also published it for browsers.

在我的手机上,当我在Chrome中查看应用程序时,我得到以下选择菜单样式:

On my phone, when I view the app in Chrome, I get the following select menu style :

但是,当我打开与PhoneGap打包的应用程序,我得到这个:

However, when I open the app packaged with PhoneGap, I get this :

完全相同的代码。

我对Android设备上的选择菜单进行了样式设置,使其看起来像Chrome中一样?

How can I style the select menu on the Android device so it appears like in Chrome?

我尝试使用--webkit-appearance,但我不知道如何使用正确...

I tried using --webkit-appearance, but I'm not sure how to use it exactly...

推荐答案

你不能更重要不应该!



每个移动平台都有自己的设计原则,旨在保持用户的最大兴趣。对于iOS,甚至可能意味着您的应用程序将被拒绝。

You can't but more important you should not!

Each mobile platform has its own design principles which are designed to keep best user's interest in mind. For iOS it could even mean that your app will be rejected.

即使不同的Android构建趋向于有不同的ui原则,如在您的图片,其中第一个显示选择菜单从原来的android和最后一个显示选择菜单从samsungs android。

Even different android builds tend to have different ui principles like in your pictures where the first one shows the select menu from original android and the last shows the select menu from samsungs android.

所以你不能使用CSS样式的选择菜单。但是你可以写一个phonegap插件来给你一个自定义的选择菜单。

So you can't style the select menu using css. However you could write a phonegap plugin to give you a custom select menu.

另一种选择是构建一个选择菜单,没有html的选择,只是javascript。但我不建议这样做。

Another option would be to build a select menu without html's select but just javascript. But I would not suggest that.

这篇关于PhoneGap& Android - 如何使用新的选择列表样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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