PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, May 10, 2022

[FIXED] How to set height on <ion-img>

 May 10, 2022     css, html, image, ionic-framework, ionic4     No comments   

Issue

I have an ionic page with an ion-img inside:

<ion-content>
  <ion-grid>
    <ion-row class="ion-padding" align-items-center justify-content-center>
      <ion-item>
        <ion-label text-wrap class="ion-text-center">
          Servicio de reportes
        </ion-label>
      </ion-item>
    </ion-row>
    <ion-row align-items-center justify-content-center >
      <ion-button size="smaill" type="submit" expand="block" routerDirection="forward" (click)="selectSource()" >Capturar imagen</ion-button>
    </ion-row>
    <ion-row>
      <ion-col>

        <ion-img [src]="selectedImage" *ngIf="selectedImage"> </ion-img>

      </ion-col>
    </ion-row>
  </ion-grid>
</ion-content>

When a picture is set to selectedImage it occupies the whole screen and more. I have to scrrol to see the full image.

I want the image to occupy 20% of the screen or a fix height.

I tried to do this in css:

ion-grid {
  height: 100%;

  ion-row {
    max-height: 33.33%;
  }
}

And also I tried to do with height property:

 <ion-img height: 10rem; [src]="selectedImage" *ngIf="selectedImage"> </ion-img>

And the image continues occupying the same space

How should I do this? Thanks for help.


Solution

if u Reduce image height write inline style< img src="" style="width:50%" >use this attribute image size(height) will reduce automatically

No option to maximize image size



Answered By - naveen pandi
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing