我是NativeScript的新手,目前正在执行此处描述的安装步骤(http://docs.nativescript.org/angular/tutorial/ng-chapter-1),我刚刚完成了PowerShell脚本的执行
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"
Run Code Online (Sandbox Code Playgroud)
然后我跑
tns doctor
Run Code Online (Sandbox Code Playgroud)
我得到
C:\>tns doctor 'tns' is not recognized as an internal or external command, operable program or batch file.
Run Code Online (Sandbox Code Playgroud) 今天突然间,我无法在{N} 2.0.1上构建我的Android应用程序
这是我在流程结束时得到的错误:
Execution failed for task ':processF0DebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/opt/android-sdk/build-tools/23.0.3/aapt'' finished with non-zero exit value 1
Run Code Online (Sandbox Code Playgroud)
是什么造成的?
我在Nativescript中有一个带有自定义页面的模式弹出窗口。我正在调用如下所示的打开弹出窗口
var modalPageModule = 'components/appointmentDetails/tabs/location/location';
var context = args.context;
var fullscreen = false;
page.showModal(modalPageModule, context, function closeCallback(location, address) {
}, fullscreen);
Run Code Online (Sandbox Code Playgroud)
在弹出窗口中,我有一个关闭按钮,应从其中关闭模式弹出窗口。
但是从参考站点,我找不到任何有用的方法来关闭模式弹出窗口。
提前致谢。
javascript hybrid-mobile-app telerik-appbuilder nativescript
我在Angular2教程中遇到以下错误.TNS医生还可以,为什么会出现以下错误?
'tns livesync ios --emulator --watch
Executing before-prepare hook from /Users//Documents/frontend/sample-Groceries/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Project successfully prepared (ios)
Executing before-livesync hook from /Users//Documents/frontend/sample-Groceries/hooks/before-livesync/nativescript-angular-sync .js
Transferring project files...
Successfully transferred all files.
Applying changes...
Successfully synced application org.nativescript.groceries on device D28D29C3-07B6-4B60-B4B0-711475C505DE.
Executing before-watch hook from /Users//Documents/frontend/sample-Groceries/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 1 0x105cd08d7 -[TNSRuntime executeModule:]
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 2 0x10587b6d2 main
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 3 0x109be668d start
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: …Run Code Online (Sandbox Code Playgroud) 您好,我正在尝试在Typescript xml页面中获取Image元素,并以编程方式设置其imageSource属性。
在示例中,我发现它是通过以下方式完成的:
image = page.getViewById("id");
image.imageSource = newImageSource;
Run Code Online (Sandbox Code Playgroud)
我在使用打字稿时遇到的问题是
error 'imageSource' does not exist on type 'View'
Run Code Online (Sandbox Code Playgroud)
我不知道如何解决该问题。有任何想法吗?
我的iphone模拟器上没有加载字体.我按照https://docs.nativescript.org/ui/styling#using-fonts列出的说明进行操作.但是,字体是为Android加载的,但不是ios.
码:
Label {
font-family: OpenSans-Regular;
}
Run Code Online (Sandbox Code Playgroud)
我在app/fonts文件夹中添加了字体OpenSans-Regular.
我正在看看nativescript hello world typescript repo,我遇到了一些与nativescript实现的observable一样乏味的工作.
如果查看视图模型的定义方式,可以看到它是一个只扩展Observable库的类.无论何时setter为属性定义方法,都需要手动调用super.notifyPropertyChange("propertyName", propertyValue);
恕我直言,如果你有具有许多属性的视图模型,这个过程非常低效且容易出错.
有没有办法自动完成这项任务?(也许有一个告诉任何setter的基类notifyPropertyChange?)如果没有,你是如何处理这个问题的?该Observable机制还有其他实现吗?
我通过运行以下命令设置了新的nativescript应用:
tns create application --ng
Run Code Online (Sandbox Code Playgroud)
当我尝试使用以下方式启动应用程序时:
tns run ios --emulator
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Unable to apply changes on device: BC7714A3-A8B0-4CEC-A7A4-D54563CF04EE. Error is: Command xcodebuild failed with exit code null.
Run Code Online (Sandbox Code Playgroud)
完整的错误是:-
Searching for devices...
Executing before-liveSync hook from /XXXXXX/Desktop/Bike/hooks/before-liveSync/nativescript-angular-sync.js
Skipping prepare.
Building project...
Xcode build...
2018-04-30 21:49:36.684 xcodebuild[1674:27197] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-13756/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/RuntimeSupport/MacroExpansion/XCMacroExpansionExtensions.mm:94
Details: Assertion failed: [value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSArray class]]
Object: <DVTMacroDefinitionTable: 0x7fab68c72bb0>
Method: -_xc_setValue:forMacroName:conditionSet:errorHandler:
Thread: <NSThread: 0x7fab68d176a0>{number = 1, name = main}
Hints:
Backtrace:
0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in …Run Code Online (Sandbox Code Playgroud) 我很惊讶我还没有在互联网上找到答案。
如何从我的本机脚本应用程序打开本机/默认应用程序?
在这种情况下,我想打开一个带有location参数的地图应用程序(不确定它是否将是字符串,坐标等)。
如何使用nativescript-vue创建轮播?我可以使用按钮和动画创建几个单独的组件,例如welcome1.vue,welcome2.vue,但是我不知道如何添加点使其成为真正的轮播/介绍流程。我知道有一个NS插件,但是我不确定如何将其集成到vue项目中。
任何帮助,将不胜感激!
nativescript ×10
javascript ×2
tns ×2
typescript ×2
angular ×1
carousel ×1
fonts ×1
imagesource ×1
ios ×1