Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Side Menu Background Image Not Working on Actual Device

$
0
0

@OliverPrimo wrote:

Good Day Everyone,

I have an Ionic 3 application which has a side menu that consists of a header and a list of menu under the header. I would like to create something like this:

The problem is that when I set a background image, it only works on the browser but when I tried the application on an actual device, it doesn’t display the background image

Browser (ionic serve)

Device

I have already tried searching the web for solutions but it all didn’t work.

Here is my code:

HTML Component

    <ion-content>
      <div header-background-image padding>
        <img menuClose [src]="domSanitizer.bypassSecurityTrustUrl(params.image)" (click)="openPage('My Profile')">
        <h2 ion-text color="light" header-title text-capitalize>{{params.name}}</h2>
        <p ion-text header-subtitle>{{params.email}}</p>
      </div>
      <ion-list no-margin no-lines>
        <button menuClose ion-item item-title main-menu *ngFor="let p of pages" (click)="openPage(p.theme)" [class.active]="checkActivePage(p.theme)">
          <ion-icon icon-medium item-left>
            <ion-icon name="{{p.icon}}"></ion-icon>
          </ion-icon>
          {{p.title}}
        </button>
      </ion-list>
    </ion-content>

Style Component

[header-background-image] {
  height: auto;
  position: relative;
  background: url('/assets/images/background/3.jpg');
  background-size: 100%;
  background-position: center bottom;
}

I hope someone can help me with this. Thank you in advance :blush:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>