标签: nativescript

如何调整从 nativescript-imagepicker 插件中选取的图像大小

我已经在我的 Nativescript -Angular 代码中实现了 nativescript 图像选择器插件,但我试图弄清楚如何调整从 nativescript-imagepicker 中选取的图像的大小,该图像可以显示为圆圈中的帐户或个人资料图片

nativescript angular2-nativescript nativescript-angular

2
推荐指数
1
解决办法
1428
查看次数

在 Nativescript 应用程序中修改 Podfile

我已在我的Nativescript应用程序中添加了一个共享扩展,该扩展需要一个 Pod。

因此,我需要修改 Nativescript 应用程序的 Podfile,以使用所需的 Pod 来定位我的共享扩展,如下所示:

target :MyApp do
    platform :ios, '8.0'
    use_frameworks!

    pod 'AFNetworking', '~> 2.0'
    pod '...'
end

target :MyExtension do
    use_frameworks!

    pod 'AFNetworking', '~> 2.0'
end

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        if target.name.start_with? "Pods-MyExtension"
            target.build_configurations.each do |config|
                config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'AF_APP_EXTENSIONS=1']
            end
        end
    end
end
Run Code Online (Sandbox Code Playgroud)

这里的问题是,每次运行项目时,Podfile 都会被 Nativescript 覆盖。

那么,有一种方法可以“阻止”Podfile 以防止 Nativescript 覆盖它,或者可能有一个“钩子”用于在 Nativescript Podfile 生成后向 Podfile 添加自定义内容?

我该如何继续?

谢谢。

ios nativescript share-extension podfile

2
推荐指数
1
解决办法
1338
查看次数

iOS 14 上的部署失败(Svelte Native、Xcode 12)

今天早上我注意到 Xcode 正在更新。完成后,我无法再在模拟器上部署我的 Svelte Native 项目:

无法在设备上应用更改:F863B5B4-A568-4311-9153-9ED22B008275。错误是:ENOENT:没有这样的文件或目录,scandir '/Users/janos/Library/Developer/CoreSimulator/Devices/F863B5B4-A568-4311-9153-9ED22B008275/data/Applications'。(我已经检查过,“应用程序”文件夹不存在,但父文件夹存在。)

有人对如何解决这个问题有任何建议吗?

nativescript svelte-native

2
推荐指数
1
解决办法
452
查看次数

NativeScript 8.0.4 Android 应用程序图标默认不会改变

我在这里撕扯我的头发。我已经使用早期版本的 nativescript 开发了应用程序,这从来没有出现过问题...这是我降级到旧版本之前的最后一次努力

我已经运行了命令 tns resourcesgenerateicons../icon.png,它声称已成功生成图标,我可以在目录中看到它们...构建并部署到手机。仍然有默认的nativescript图标

我转到 App_Resources/Android/src/main/res 并手动更新每个 mipmap 目录中的 ic_launcher.png 文件...构建并部署到手机,结果相同!默认图标

尝试删除 platform/android 目录并重建。没有运气

我从根目录进行搜索,但我无法弄清楚这个默认图标怎么仍然出现!

注意:我能够更改启动屏幕

任何帮助...请,谢谢

icons android nativescript

2
推荐指数
1
解决办法
1443
查看次数

“Python”命令需要命令行开发人员工具在 macOS 12.5 上使用 Xcode 13.4.1 循环

我的设置是 2021 MBP,配备 M1 Pro 处理器、macOS 12.5 和 Xcode 13.4.1。我正在使用 NativeScript 构建一个应用程序,但无法发布该应用程序,因为每次我转到product> archiveXcode 时都会显示“Python 命令需要命令行工具”。当我同意安装时,它看起来就像已安装,但随后又重新开始。

我重置了 Mac 并重新安装了 macOS,因此使用了全新的设置。首先,我遵循 NativeScript 文档( https://docs.nativescript.org/environment-setup.html#macos-ios )的建议并运行sudo ln -s $(which python3) /usr/local/bin/python,它为 python 2.x 创建了一个别名。然后做了python3 -m pip install --upgrade pippython3 -m pip install six。测试了我的配置ns doctor ios- 它抱怨缺少 python 和 Xcode 对话框提示我安装 python。单击安装,完成,运行ns doctor ios并重新开始。

虽然 macOS 12.5 似乎附带了 python3,但是没有一个选项对我有用。

后来发现一篇文章,作者建议使用pyenv. 所以我走了这条路,全局安装它并将 env 设置到我的 shell 中。重新测试并得到同样的错误。

Xcode-select -p结果是 …

python macos xcode nativescript xcode-command-line-tools

2
推荐指数
1
解决办法
1万
查看次数

如何使用默认应用程序打开文件

我正在从DropBox下载文件.

我可以通过使用看到该文件存在File.exists(filePath)并返回true.但我无法使用File.fromPath(filePath)或使用任何一个打开文件(使用默认应用程序)openUrl(filePath).

这是我的代码:

HomePage.prototype.getDownload = function() {
var filePath = fs.path.join(fs.knownFolders.currentApp().path, "MyFile");

httpModule.getFile({
    url: "https://content.dropboxapi.com/2/files/download",
    method: "POST",
    headers: { "Content-Type": "", "Dropbox-API-Arg": JSON.stringify({"path": "/MyFolder/MyFile"}), "Authorization": "Bearer *********" },      
}, filePath).then(function (response) {
    console.log("file exists: "+fs.File.exists(filePath)); // This return true
    // tried this
    fs.File.fromPath(filePath); // Does nothing
    // tried this
    utilsutils.openUrl(filePath); // Does nothing
}
Run Code Online (Sandbox Code Playgroud)

nativescript

1
推荐指数
1
解决办法
2566
查看次数

NativeScriptException:找不到模块:"stream"

升级了我的package.json中的一些项目后,我突然得到:

Error: com.tns.NativeScriptException: Failed to find module: "stream", relative to: /app/tns_modules/

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.naturesnotebookmobile/files/app/tns_modules/parse5/lib/parser/stream.js', line: 3, column: 22
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?以前我所有角度的东西都是2.0.0,然后就可以了.这是我的package.json:

{
  "dependencies": {
    "@angular/common": "2.1.0",
    "@angular/compiler": "2.1.0",
    "@angular/core": "2.1.0",
    "@angular/forms": "2.1.0",
    "@angular/http": "2.1.0",
    "@angular/platform-browser": "2.1.0",
    "@angular/platform-browser-dynamic": "2.1.0",
    "@angular/platform-server": "2.1.0",
    "@angular/router": "3.1.0",
    "crypto-js": "^3.1.7",
    "nativescript-angular": "1.1.0",
    ... a few other things here...
    "node-geocoder": "^3.15.0",
    "oauth-signature": "^1.3.1",
    "reflect-metadata": "^0.1.8",
    "tns-core-modules": "2.3.0",
    "util": "^0.10.3"
  },
  "devDependencies": {
    "babel-traverse": "6.16.0",
    "babel-types": "6.16.0",
    "babylon": "6.12.0",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": …
Run Code Online (Sandbox Code Playgroud)

nativescript angular2-nativescript

1
推荐指数
1
解决办法
789
查看次数

Angular2/Nativescript:如何突出显示ListView的选定项?

我已经阅读了Nativescript ListView文档并搜索了Google,无法找到任何方法来突出显示当前所选的Listview项目......这甚至可能吗?如果是这样我该怎么办呢?

我的代码:

<ListView [items]="activeStockTakes" class="list-group" (itemTap)="selectActiveStockTake($event)">
                    <template let-activeStockTake="item">
                        <StackLayout>
                            <Label class="list-group-item" [text]="activeStockTake.UserCode + ' - ' + activeStockTake.Comment"></Label>
                        </StackLayout>
                    </template>
                </ListView>
Run Code Online (Sandbox Code Playgroud)

css nativescript angular2-nativescript

1
推荐指数
1
解决办法
1532
查看次数

是什么导致此Macbook Pro上的nativescript安装错误

我已经安装,卸载,清理了npm缓存并重新安装。仍然出现以下错误并且是MacBook Pro的新手,我不知道发生了什么。

Johns-MBP:〜jbaird $ npm install -g nativescript npm警告可选的跳过可选依赖:abbrev@1.1.0(node_modules / nativescript / node_modules / fsevents / node_modules / abbrev):npm WARN enoent跳过可选的可选文件:ENOENT或目录,重命名为'/ usr / local / lib / node_modules / nativescript / node_modules / fsevents / node_modules / abbrev'->'/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.abbrev.DELETE'

npm ERR!路径/ usr / local / lib / node_modules / nativescript / node_modules / fsevents / node_modules / ansi-regex npm ERR!代码ENOENT npm ERR!errno -2 npm错误!syscall重命名npm ERR!enoent ENOENT:没有这样的文件或目录,请重命名'/ usr / local / lib / node_modules / nativescript / node_modules / fsevents / node_modules …

nativescript

1
推荐指数
1
解决办法
747
查看次数

使用iframe在Nativescript Webview中上传文件

我的问题是我有一个包含动态表单的Webview或由WP Builders动态创建的表单,并且包含在iframe中,我想从nativescript应用程序中选择文件,这将不允许我选择文件。

所以我想尝试

如何使用本机脚本将文件加载到Webview中

http://shripalsoni.com/blog/nativescript-webview-native-bi-directional-communication/

但是问题是形式是动态的,如果我们可以检测到文件输入单击事件,是否有任何脚本会检测框架内文件输入的单击事件,并在选择文件时将文件路径放置到该脚本中。

另一个问题是,如果以动态形式输入了多个文件,该怎么办?

javascript webview nativescript

1
推荐指数
1
解决办法
479
查看次数