Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 背景上的离子多重和动态图像_Angular_Ionic Framework_Sass_Ionic4 - Fatal编程技术网

Angular 背景上的离子多重和动态图像

Angular 背景上的离子多重和动态图像,angular,ionic-framework,sass,ionic4,Angular,Ionic Framework,Sass,Ionic4,我一直在尝试添加多个图片,已经发布了一个问题,但有不同的问题,但终点是相同的 <ion-content [style.background-image]="'url(https://restcountries.eu/data/ala.svg)', 'url(https://restcountries.eu/data/ala.svg)'" [style.background-size]="'100% 50%, 100% 50%'" [st

我一直在尝试添加多个图片,已经发布了一个问题,但有不同的问题,但终点是相同的

<ion-content [style.background-image]="'url(https://restcountries.eu/data/ala.svg)', 'url(https://restcountries.eu/data/ala.svg)'"
             [style.background-size]="'100% 50%, 100% 50%'" 
             [style.background-repeat]="'no-repeat, repeat'"> 

对于多个图像,它不会显示,但对于一个图像,它会按预期显示

<ion-content [style.background-image]="'url('+ fromFlag +')'"
             [style.background-size]="'100% 50%, 100% 50%'" 
             [style.background-repeat]="'no-repeat, repeat'">


有人能帮助我如何在背景上添加第二个图像吗?

您可以使用此解决方案在背景上动态添加多个图像

[ngStyle]=“{'background-image':'url('+fromFlag+')、url('+fromFlag+')”}”

<ion-content 
    [ngStyle]="{'background-image': 'url(' + fromFlag + '),url(' + fromFlag + ')'}"
    [style.background-size]="'100% 50%, 100% 50%'" 
    [style.background-repeat]="'no-repeat, repeat'"
>