如何添加自定义图标离子2,我有svg文件,我需要在菜单中添加图标
this.pages = [
{icon: 'Test', title: 'Logout', component: LoginPage }
];
<ion-list>
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
<ion-icon name="{{p.icon}}" svgversion item-left></ion-icon>
{{p.title}}
</button>
</ion-list>
Run Code Online (Sandbox Code Playgroud)
layout.scss
ion-ion[name="test"][svgversion] {
content: url("../../img/accountsDeposits.svg");
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用角度来构建离子(1)app.我不明白为什么我会收到这个警告
"Blink推迟了一项任务,以使滚动更顺畅.您的计时器和网络任务运行时间不应超过50毫秒,以避免这种情况.请参阅https://developers.google.com/web/tools/chrome-devtools/profile/评估性能/铁路和https://crbug.com/574343#c40获取更多信息."
当我使用页面滑块时,还有其他警告
"忽略尝试使用cancelable = false取消touchmove事件,例如因为滚动正在进行且无法中断."
"由于主线程忙,"触摸启动'输入事件的处理延迟了835毫秒.考虑将事件处理程序标记为"被动"以使页面响应更快"
目前我正在为android和ios开发离子2项目.我在启动画面之后和主页面之前看到了白色的空白屏幕.此空白页需要9或8秒才能完成.我使用以下命令
ionic start CoeTutorial tutorial --v2
ionic resources
ionic platform add android
ionic run android
Run Code Online (Sandbox Code Playgroud)
为什么白色空白屏幕会出现以及如何使其更快?
这是我的项目链接:https: //drive.google.com/file/d/0B8MgjhwD8M3UTVprWEd1cEk2dW8/view?usp=sharing
需要输入
npm install
Run Code Online (Sandbox Code Playgroud)
下载此示例项目后.
我正在尝试在标题位于中心的离子标题的每一侧添加两个图标,但它总是以右侧的两个图标结束.
这是我的代码
<ion-header>
<ion-navbar color="primary">
<ion-buttons start>
<button ion-button icon-only><ion-icon name="chatboxes"></ion-icon></button>
</ion-buttons>
<ion-title>Title</ion-title>
<ion-buttons end>
<button ion-button icon-only><ion-icon name="notifications"></ion-icon></button>
</ion-buttons>
</ion-navbar>
</ion-header>
Run Code Online (Sandbox Code Playgroud)
这导致这个标题:
我无法弄清楚,尝试了不同类型的教程,并试图复制他们的例子没有任何成功.它背后也没有造型,所以没有什么可以搞乱布局.感觉就像这个版本的Ionic或其他东西中的"开始"元素一样.有人能指出我正确的方向吗?
运行"离子信息"时这是我的输出:
Your system information:
ordova CLI: 6.5.0
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.3
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.5
Xcode version: Not installed
Run Code Online (Sandbox Code Playgroud) 我需要在离子3中的购物车图标上添加一个数字徽章,以便用户获得购物车中元素数量的更新而不实际访问页面我试图一起使用按钮和徽章的代码但是它没有用
<button ion-button icon-only (click)="cart()">
<ion-icon name="cart"> <ion-badge item-end>260k</ion-badge></ion-icon>
</button>
Run Code Online (Sandbox Code Playgroud)
上面的代码显示了购物车图标旁边的徽章,但没有显示在它上面,所以有没有办法像我们在通知警报徽章中那样为图标本身添加徽章?
我是Ionic的初学者2.我想在点击列表项后将Json数据从一个页面传递到另一个页面.列表中的项目来自json,并且具有与每个项目相关联的特定ID.所以我想在特定项目上的点击事件之后传递特定的id.
这是json链接:
1. http://factoryunlock.in//products借助此链接,我将在列表中显示产品
2.但现在我想表明,特定项目的细节.所以我用这个链接
http://factoryunlock.in/products/1
Run Code Online (Sandbox Code Playgroud)
我想products/1在特定项目的click事件后更改该ID(在链接2中).
这是我的Listview代码(Second.ts).
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { EarthquakesProvider } from '../../providers/earthquakes/earthquakes';
import { DetailsPage } from '../details/details';
import { ChartsPage } from '../charts/charts';
@IonicPage()
@Component({
selector: 'page-second',
templateUrl: 'second.html',
providers: [EarthquakesProvider]
})
export class SecondPage {
public DateList: Array<Object>;
constructor(public _navCtrl: NavController,
public _earthquakes: EarthquakesProvider) {
this.getEarthquakes();
}
public Listitem(l) {
this._navCtrl.push(DetailsPage
);
}
public openModal() {
this._navCtrl.push(ChartsPage);
} …Run Code Online (Sandbox Code Playgroud) hybrid-mobile-app ionic-framework multi-device-hybrid-apps ionic2 angular
在我的离子应用程序中,我列出了youtube嵌入视频如下:
<iframe allowfullscreen frameborder="0" height="200" width="100%" [src]="video.url">
</iframe>
Run Code Online (Sandbox Code Playgroud)
video.url是从以下函数生成的
generateVideoUrl(videoId) {
return this.sanitizer.bypassSecurityTrustResourceUrl("https://www.youtube.com/embed/" + videoId + "?rel=0&showinfo=0");
}
Run Code Online (Sandbox Code Playgroud)
它工作正常,但我也想捕获像youtube视频暂停,结束或开始播放等事件.我试图导入这个http://brandly.github.io/angular-youtube-embed/#/并使用它与我的ionic3应用程序,但这给出错误'角度未定义'.Ionic确实使用了角度,但可能会使用不同的角度来生成角度未定义的误差.
谢谢你的帮助.
我正在尝试从rxjs5 迁移到6,但是我遇到了困难。当我尝试这个
this._connectivity.isOnline().pipe(first()).subscribe((state) => {
this.syncCheck(user.uid);
});
Run Code Online (Sandbox Code Playgroud)
我收到此错误
Argument of type 'MonoTypeOperatorFunction<any>' is not assignable to parameter of type 'UnaryFunction<Observable<any>, Observable<any>>'.
Types of parameters 'source' and 'source' are incompatible.
Type 'import("/home/User/Desktop/projectname/node_modules/rxjs/Observable").Observable<any>' is not assignable to type 'import("/home/User/Desktop/projectname/node_modules/rxjs/internal/Observable").Observable<a...'.
Property 'map' is missing in type 'Observable<any>'.
Run Code Online (Sandbox Code Playgroud) 我是ionic3的新手,我有2页,一个是列表页面,有上市,我从Rest API获取该列表,当我点击该列表中的特定项目,那时我想获得该页面的详细信息,但是当我点击特定项目时我收到错误:ListDetailsPage is part of the declaration of 2 modules, Please consider moving ListDetailsPage to a higher module that imports AppModule and ListDetailsPageModule,有谁可以请帮助我为什么我收到此错误?在这里,我添加了我的所有代码,
1)app.module.ts
import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { AboutPage } from '../pages/about/about';
import { ContactPage } from '../pages/contact/contact';
import { HomePage } from '../pages/home/home';
import { ListPage } from '../pages/list/list';
import { ListDetailsPage …Run Code Online (Sandbox Code Playgroud) 在我的Ionic应用程序上遇到一个奇怪的问题,我昨天能够构建得很好但是在一个构建版本中它下载了一堆像构建android时那样的文件然后我收到了以下错误:
找不到support-vector-drawable.aar(com.android.support:support-vector-drawable:27.1.1).在以下位置搜索:https: //jcenter.bintray.com/com/android/support/support-vector-drawable/27.1.1/support-vector-drawable-27.1.1.aar
在链接后https://jcenter.bintray.com/com/android/support/support-vector-drawable/27.1.1/support-vector-drawable-27.1.1.aar,页面具有以下JSON:
{
"errors": [
{
"status": 404,
"message": "Could not find resource"
}
]
}
Run Code Online (Sandbox Code Playgroud) ionic-framework ×10
angular ×5
ionic2 ×5
ionic3 ×4
cordova ×2
css ×2
typescript ×2
android ×1
angularjs ×1
html ×1
ionic-view ×1
javascript ×1
rxjs ×1
sass ×1
youtube ×1