我是Ionic框架的新手,我正试图用这样的全屏背景图像启动应用程序:

我确实设法删除了教程中显示的状态栏.但是如何添加全屏图像?当我将它添加到style.css时,它没有做出反应:
html, body{
background-image: black;
}
Run Code Online (Sandbox Code Playgroud) 我想导航到另一个状态/屏幕并将一个简单的json对象传递给下一个屏幕.
我有以下内容:
var benefit = { "x": "y"};
$state.go('pages.claimed', { 'benefit': benefit });
Run Code Online (Sandbox Code Playgroud)
我的州看起来像这样:
.state('pages.claimed', {
url: '/claimed',
views: {
'page': {
templateUrl: 'templates/pages/claimed.html'
}
}
})
Run Code Online (Sandbox Code Playgroud)
但是,我无法访问pages.claimed视图中的"benefit"对象/参数.我正在使用基于角度的离子框架.
谢谢你指点我正确的方向!
只是学习使用Ionic来构建混合应用程序,并且无法在ionic prepare命令中找到大量信息.有人碰巧知道它是什么或者它和它之间有什么区别ionic build?
我目前正在浏览网页以获取信息,目的是构建经典棋盘游戏的Web和移动版本.
我们的想法是在桌面版本上拥有完整的功能和游戏,以及一个简单的原生移动应用程序,它将允许用户玩游戏并更改一些设置.
现在,我习惯于为桌面构建Web应用程序,但我从未接触过像Cordova/Ionic这样的东西.
我还想补充一点,我确实打算有一天将应用程序投入生产.
我有几个问题:
我正在尝试从任何使用过上述任何技术的人那里收集尽可能多的信息,所以请随意回答这篇文章的部分内容,以便我可以编译所有内容.
非常感谢您的时间和帮助
我正在尝试将Ionic.io Push添加到我的应用程序,但它的投射离子没有定义
ReferenceError: Ionic is not defined
var push = new Ionic.Push({
Run Code Online (Sandbox Code Playgroud)
一切正常,除了这个未定义的错误,我运行此命令更新lib但没有任何反应,捆绑版本是*Ionic,v1.1.0
ionic lib update
Run Code Online (Sandbox Code Playgroud)
我的app.js.
angular.module('TestApp', ['ionic','ionic.service.core',
'ionic.service.push',
'lavoApp.controllers',
'lavoApp.services','ngCordova'])
.run(function($ionicPlatform,$rootScope,$location,$timeout,$anchorScroll,$state,$ionicHistory,$cordovaPush) {
$ionicPlatform.ready(function() {
var push = new Ionic.Push({
"debug": true
});
push.register(function(token) {
console.log("Device token:",token.token);
});
Run Code Online (Sandbox Code Playgroud) 来自不同用户的问题视频但是相同
我有一个背景图像设置如下:
.pane {
background-image: url("../img/inner-banner-bg.jpg");
background-repeat: repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)
在我的config.xml中
<preference name="Fullscreen" value="false"/>
Run Code Online (Sandbox Code Playgroud)
现在我遇到的问题是当键盘完成/搜索后键盘消失时,它会在键盘覆盖的空间过渡期间留下类似0.5的白色背景,看起来有点糟糕.
当键盘关闭时,它不会收缩但会留下白色间隙.如何让键盘不缩小背景幕后的视图?
当我设置
<preference name="Fullscreen" value="true"/>
Run Code Online (Sandbox Code Playgroud)
它不会发生.我也在使用Ionic插件键盘.
无论如何,我可以使键盘褪色的过渡不显示白色背景?
编辑:这是我的android设置
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
和我的配置设置
<access launch-external="yes" origin="geo:*"/>
<allow-intent href="geo:*"/>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="4000"/>
<preference name="FadeSplashScreen" value="false"/>
<preference name="ShowSplashScreenSpinner" value="true"/>
<preference …Run Code Online (Sandbox Code Playgroud) 我想在每次页面更改时执行一些代码.
我可以ngOnDestroy为每个页面添加一个方法.似乎我可以使用Ionic 2页面生命周期钩子(例如ionViewDidUnload)获得完全相同的效果,但我没有费心去测试它.我宁愿在主app类中添加一个方法.
我看到你可以订阅Angular 2 路由器事件.如何翻译用于Ionic 2?我首先得到一个错误import { Router } from '@angular/router;:
TypeScript error: <path>/node_modules/@angular/router/src/common_router_providers.d.ts(9,55): Error TS2305: Module '"<path>/node_modules/@angular/core/index"' has no exported member 'NgModuleFactoryLoader'.
TypeScript error: <path>/node_modules/@angular/router/src/router.d.ts(14,39): Error TS2305: Module '"<path>/node_modules/@angular/core/index"' has no exported member 'NgModuleFactoryLoader'.
TypeScript error: <path>/node_modules/@angular/router/src/router_module.d.ts(9,10): Error TS2305: Module '"<path>/node_modules/@angular/core/index"' has no exported member 'ModuleWithProviders'.
Run Code Online (Sandbox Code Playgroud)
webpack配置
var path = require('path');
module.exports = {
entry: [
path.normalize('es6-shim/es6-shim.min'),
'reflect-metadata',
path.normalize('zone.js/dist/zone'),
path.resolve('app/app.ts')
],
output: {
path: path.resolve('www/build/js'),
filename: 'app.bundle.js',
pathinfo: false …Run Code Online (Sandbox Code Playgroud) 不要将此问题标记为重复,stackoverflow上的任何答案都不 适合我.其中很多是针对Ionic 1或者那些答案已被弃用或者它们不适用于Android设备.
我已经在stackoverflow上看到很多关于获取设备当前位置的解决方案,但是没有解决方案似乎适用于Android.
我试过的: -
使用geolocation.getCurrentPosition(),适用于IOS和浏览器,但不适用于Android.
使用this.geolocation.watchPosition() ,适用于IOS和浏览器,但不适用于Android.
使用navigator.geolocation.getCurrentPosition(),适用于IOS和浏览器,但不适用于Android.
使用此问题提供的小提琴解决方案getCurrentPosition()和watchPosition()在不安全的起源上被弃用
无论如何,所有这些都被谷歌弃用,原因是: -
getCurrentPosition()和watchPosition()在不安全的起源上被弃用,将来会删除支持.您应该考虑将应用程序切换到安全的来源,例如HTTPS.有关详细信息,请参阅goo.gl/rStTGz.
background-geolocation plugin但是,它在Android设备上花费了近50-55秒,再次它对ios工作正常 这个问题joshmorony(https://www.joshmorony.com/adding-background-geolocation-to-an-ionic-2-application/)解决方案前景不工作为Android物理设备,但做工精细的浏览器和iOS.背景跟踪工作正常,这是第一次花费将近50秒的时间来进行拉动.
请帮我解决一下这个.我想要一种在最短时间内获得当前位置的方法.对于您的信息,我使用谷歌javascript地图sdk/api.
我通过这两个命令升级了我的 Ionic 4 应用程序:
# Upgrading to Ionic 5
npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save
# Upgrading to Angular 9
ng update @angular/core @angular/cli
Run Code Online (Sandbox Code Playgroud)
当我这样做时ionic serve,我开始收到此错误:
> ng run app:serve --host=localhost --port=8100
[ng] chunk {} 0.js, 0.js.map () 22.1 kB [rendered]
[ng] chunk {common} common.js, common.js.map (common) 25.7 kB [rendered]
[ng]
[ng] ERROR in ./src/zone-flags.ts
[ng] Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
[ng] Error: /Users/shashank/Projects/my-app/mobile-app/src/zone-flags.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via …Run Code Online (Sandbox Code Playgroud) 当我在 GitHub 中运行 Apk 时,出现错误。当我在 GitHub 中构建 Apk 时。无法定义清单内的某些内容,因为它每次都是新鲜构建的。我所能做的就是在 Config.Xml 文件中。添加后android:exported="false",也出现同样的错误。此问题参考的两张图片均附在此处。GitHub 错误和Config.Xml。帮助将不胜感激。
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.likehub.sweetheart" version="1.1.64" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>sweetheart</name>
<description>making love bird together</description>
<author email="mynamey9er@gmail.com" href="">likehub</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="AndroidXEnabled" value="true" />
<preference name="WebViewBounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="LoadUrlTimeoutValue" value="700000" />
<preference name="ScrollEnabled" …Run Code Online (Sandbox Code Playgroud)ionic-framework ×10
cordova ×4
angular ×3
angularjs ×3
android ×2
ionic2 ×2
ionic3 ×2
node.js ×2
typescript ×2
css ×1
github ×1
javascript ×1
reactjs ×1