我是Ionic 2的初学者.我想在Ionic中使用相机.我关注了https://ionicframework.com/docs/native/camera/ tutorial.我已经安装了cordova-plugin-camera插件并使用cli代码安装了ionic-native/camera.
当我为项目服务时,它显示运行时错误:
未捕获(承诺):错误:没有相机提供商!injectionError
我发送app.module.ts,html页面,并输入脚本页面.请看一看.
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 { HttpModule } from '@angular/http';
import { AboutPage } from '../pages/about/about';
import { ContactPage } from '../pages/contact/contact';
import { HomePage } from '../pages/home/home';
import { TabsPage } from '../pages/tabs/tabs';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import …Run Code Online (Sandbox Code Playgroud) 嗨,我正在使用"android.support.v4.widget.DrawerLayout"抽屉.我想改变抽屉图标的颜色.请告诉我如何做到这一点.我分享我的代码.请看一下并建议我如何更改图标颜色更改.
toolbar = (Toolbar) findViewById(R.id.tool_bar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationIcon(R.drawable.drawer);
toolbar.hideOverflowMenu();
getSupportActionBar().setTitle(null);
ImageView img = (ImageView) findViewById(R.id.imgCourses);
mRecyclerView = (RecyclerView) findViewById(R.id.RecyclerView);
mRecyclerView.setHasFixedSize(true);
Drawer = (DrawerLayout) findViewById(R.id.DrawerLayout);
mAdapter = new MyAdapter(TITLES,NAME,EMAIL,PROFILE,this);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setVerticalScrollBarEnabled(false);
mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
mDrawerToggle = new ActionBarDrawerToggle(this,
Drawer,
toolbar,
R.string.openDrawer,
R.string.closeDrawer)
{
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
}
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
}
};
Drawer.setDrawerListener(mDrawerToggle);
mDrawerToggle.syncState();
Drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
Run Code Online (Sandbox Code Playgroud)