Android 爱奥尼亚科尔多瓦QRS扫描仪布局不一致?
我的qrscanner布局与我的布局不一致。iOS和web视图上的Qrcode看起来很正常,但在android上它有点不稳定(不居中) 以下是Android上的屏幕截图: 以下是iOS上的屏幕截图: 这是我的离子/角度代码:Android 爱奥尼亚科尔多瓦QRS扫描仪布局不一致?,android,ios,angular,ionic-framework,layout,Android,Ios,Angular,Ionic Framework,Layout,我的qrscanner布局与我的布局不一致。iOS和web视图上的Qrcode看起来很正常,但在android上它有点不稳定(不居中) 以下是Android上的屏幕截图: 以下是iOS上的屏幕截图: 这是我的离子/角度代码: <ion-card-content class="qr-canvas"> <qrcode style=" justify-content: center;" [qrdata]="qrCode"
<ion-card-content class="qr-canvas">
<qrcode
style=" justify-content: center;"
[qrdata]="qrCode"
[size]="300"
[level]="'Q'"
colorlight="#e9ecef"
*ngIf="qrCode!==''">
</qrcode>
<ion-button expand="block" (click)="copyToClipboard()" [disabled]="!isEmpty">
<ion-icon name="copy" slot="start"></ion-icon>
Copy to clipboard
</ion-button>
<ion-item>
<p style="text-align: center;">
This address can be used for any
</p>
</ion-item>
</ion-card-content>
我能做些什么来解决这个问题?多谢各位-
埃利亚斯我终于解决了这个问题 我通过了[size]属性的双向绑定 }
.wrap-qr-code {
flex-wrap: wrap;
}
ion-card-content {
justify-content: center;
align-items: center;
}
.qr-canvas {
width: 100%;
padding: 5px;
border-radius: 5px;
border-style: solid;
border-color: #00AAC8;
}
<qrcode
[qrdata]="qrCode"
[size]="canvasSize" <!-- passed it a canvasSize property in the .ts (public canvasSize = 0;) -->
[level]="'Q'"
colorlight="#e9ecef"
colorDark="#000000"
*ngIf="qrCode!==''">
</qrcode>
console.log("Canvas size: " + this.canvasSize);