<input type="file> 在 Corona SDK Android 网络应用程序中不起作用
<input type="file> does not work in Corona SDK Android web app
我使用 Corona SDK 创建了一个 android 应用程序,它只会在应用程序中打开我网站的移动版本。我这样做只是因为我不知道 Java,而且我无法从头开始完全编写应用程序。它可以很好地打开网站,看起来不错,但是当我单击 "Choose File" 按钮时,我网站上的按钮是 <input type="file">
,没有任何反应。小按钮被按下,但没有显示打开文件的对话框。要在我的 Corona 应用程序中打开网站,我使用 native.newWebView("foobar.com")
。在该函数的文档中,它确实说: "Native web views are not part of the OpenGL canvas and do not obey the display object hierarchy, so they will always appear in front of normal display objects including images, text, and vector objects." 这是问题所在吗?我希望文件打开对话框能够在我的应用程序中打开。
(在我网站的实际移动版本上(在 android 网络浏览器中),文件对话框确实打开正确)。
您显然是在尝试访问外部存储。试试这样的 build.setting。
settings =
{
orientation =
{
default = "portrait",
supported = { "portrait" },
},
android =
{
usesPermissions =
{
"android.permission.INTERNET",
"android.permission.READ_EXTERNAL_STORAGE",
"android.permission.READ_INTERNAL_STORAGE",
},
usesFeatures =
{
{ name = "android.hardware.location", required = false },
{ name = "android.hardware.location.gps", required = false },
{ name = "android.hardware.location.network", required = false },
},
},
iphone =
{
plist =
{
CFBundleIconFile = "Icon.png",
CFBundleIconFiles =
{
"Icon.png",
"Icon@2x.png",
"Icon-60.png",
"Icon-60@2x.png",
"Icon-72.png",
"Icon-72@2x.png",
"Icon-76.png",
"Icon-76@2x.png",
"Icon-Small.png",
"Icon-Small@2x.png",
"Icon-Small-40.png",
"Icon-Small-40@2x.png",
"Icon-Small-50.png",
"Icon-Small-50@2x.png",
},
},
},
}
我使用 Corona SDK 创建了一个 android 应用程序,它只会在应用程序中打开我网站的移动版本。我这样做只是因为我不知道 Java,而且我无法从头开始完全编写应用程序。它可以很好地打开网站,看起来不错,但是当我单击 "Choose File" 按钮时,我网站上的按钮是 <input type="file">
,没有任何反应。小按钮被按下,但没有显示打开文件的对话框。要在我的 Corona 应用程序中打开网站,我使用 native.newWebView("foobar.com")
。在该函数的文档中,它确实说: "Native web views are not part of the OpenGL canvas and do not obey the display object hierarchy, so they will always appear in front of normal display objects including images, text, and vector objects." 这是问题所在吗?我希望文件打开对话框能够在我的应用程序中打开。
(在我网站的实际移动版本上(在 android 网络浏览器中),文件对话框确实打开正确)。
您显然是在尝试访问外部存储。试试这样的 build.setting。
settings =
{
orientation =
{
default = "portrait",
supported = { "portrait" },
},
android =
{
usesPermissions =
{
"android.permission.INTERNET",
"android.permission.READ_EXTERNAL_STORAGE",
"android.permission.READ_INTERNAL_STORAGE",
},
usesFeatures =
{
{ name = "android.hardware.location", required = false },
{ name = "android.hardware.location.gps", required = false },
{ name = "android.hardware.location.network", required = false },
},
},
iphone =
{
plist =
{
CFBundleIconFile = "Icon.png",
CFBundleIconFiles =
{
"Icon.png",
"Icon@2x.png",
"Icon-60.png",
"Icon-60@2x.png",
"Icon-72.png",
"Icon-72@2x.png",
"Icon-76.png",
"Icon-76@2x.png",
"Icon-Small.png",
"Icon-Small@2x.png",
"Icon-Small-40.png",
"Icon-Small-40@2x.png",
"Icon-Small-50.png",
"Icon-Small-50@2x.png",
},
},
},
}