LoginSignup
4
2

More than 5 years have passed since last update.

IonicでAndroidとiOSの見た目を統一する

Last updated at Posted at 2018-02-08

はじめに

Ionicでハイブリットアプリを作っていたところ、iOSではいい感じの見た目なのにandroidで見るとなんかださい・・・
一部の人に怒られそうだけど、全部iOSの見た目にしたいなー。

そもそも

Ionicでは起動した端末によってスタイルが勝手に変わるようになってる。すごーい。
Platform Specific Styles
※PCで開発するときはchromeのデペロッパーツールから表示端末を選択することで、切り替えができる。
(めちゃ便利)

これでかっこよくなればいいけど、別にwebアプリだし表示一緒でよくない?って人も中にはいるはず。

こう書く

ionicのcliで生成されたapp.module.tsに勝手に書かれてるimport文に追加。

app.module.ts
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';

@NgModule({

~~中略~~

  imports: [
    IonicModule.forRoot(MyApp, {
      mode:'ios'
    }),
  ],

~~中略~~

参考

https://github.com/ionic-team/ionic/issues/12382
https://github.com/ionic-team/ionic/pull/8017

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2