ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

the lines can't display on android phone

Open zyxins opened this issue 10 years ago • 11 comments

  1. set the whole app in ios’s style: IonicModule.forRoot(VehicleApp, { mode:'ios' }, {})
  2. The line of each entry in the list below on the android mobile phone can't display properly, but through the ionic serve, in the PC browser display is normal.

code in template.html:

<ion-list> <button ion-item icon-left> <ion-icon name="car" item-left></ion-icon> one </button> <button ion-item icon-left> <ion-icon name="cash" item-left></ion-icon> two </button> <button ion-item icon-left> <ion-icon name="book" item-left></ion-icon> three </button> </ion-list>


Your system information: ionic-angular: 2.0.0-rc.1 Cordova CLI: 6.3.1 Gulp version: CLI version 1.2.2 Gulp local: Ionic CLI Version: 2.1.1 Ionic App Lib Version: 2.1.1 OS:

Node Version: v6.9.1

zyxins avatar Oct 27 '16 13:10 zyxins

Hello, could you post a screenshot of the issue you are seeing on the Android device? Also, what version of Android is the device running?

jgw96 avatar Oct 27 '16 18:10 jgw96

Hi,Below are screenshots and version information: run ionic serve

template code:

<ion-header> <ion-navbar> <ion-title>Infomation</ion-title> </ion-navbar> </ion-header> <ion-content> <ion-list> <button ion-item > Name </button> <button ion-item > Nickname </button> <button ion-item> Mobile </button> </ion-list> <ion-list> <button ion-item> Other Info </button> </ion-list> </ion-content>

display on Android(Version 5.0.1): android

display on PC Browser(Win10,Chrome Version 54.0.2840.59 m) chrome on pc

zyxins avatar Oct 28 '16 01:10 zyxins

@zyxins unfortunately I am still having issues reproducing this issue. If you try on the Android emulator do the lines show up?

jgw96 avatar Oct 31 '16 15:10 jgw96

The following is the display of the screenshots on the simulator: emulator

zyxins avatar Nov 02 '16 09:11 zyxins

I have the same problem,when set the whole app in ios’s style, all border is none

NamelessChen avatar Nov 29 '16 06:11 NamelessChen

on the android

NamelessChen avatar Nov 29 '16 06:11 NamelessChen

Encountered the same problem rc.3 seeking answers

adongroom avatar Dec 14 '16 06:12 adongroom

This is because $hairlines-width is set to less than 1 px. This variable is used in iOS-only theming to set a border to a true "1 device pixel". This article has a nice summary of the retina display hairline problem.

Later versions of Chrome (and the Android WebView) correctly round up to 1px, while earlier versions round down to 0px. I believe Android 6+ will show the hairline borders correctly, while 5- will not. Here is the actual bug ticket:

https://bugs.chromium.org/p/chromium/issues/detail?id=229428

The crux of your problem is that you've set the theming to iOS, which is using that less than 1px border on Android. You could fix this with CSS, either by overriding the variable:

$hairlines-width: 1px;

@import 'ionic.theme.default';

Easy and simple, but the downside is that hairlines will look larger on retina iOS devices. Alternatively, you can go through all the places $hairlines-width is being used and force it to 1px on Android only.

.md {
  .list-header-ios,
  // ... and a whole lot of other places
  // ...
  .searchbar-ios {
    border-width: 1px !important;
  }
}

@import 'ionic.theme.default';

Pros: iOS and Android now look correct. Cons: you've got to search and override all those places, and you have to update and maintain any new iOS features that use the $hairlines-width variable.

My personal opinion would be to use the first option, deal with the slightly larger lines on iOS, and remove it later once you drop support for Android 5-.

hotforfeature avatar Jan 30 '17 21:01 hotforfeature

Hello all! Is this still an issue? I cannot reproduce on a Moto G running Android 4.4.4.

jgw96 avatar Apr 14 '17 17:04 jgw96

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

jgw96 avatar May 05 '17 18:05 jgw96

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 03 '18 03:09 ionitron-bot[bot]