0

*ngIf is not working in the below code for changing the image in Android 10 mobile.

**<StackLayout>
    *<ng-container *ngIf="isClickedRecord && !isRecordAvailable">
        <Image src="res://record_message_enable" class="record-msg"  (tap)="startRecordingAnnouncement()"></Image>
        *<ng-container *ngIf="!changeLanguage">
            <Label text=" {{'Record Message'| translate}}" class="record-text"  horizontalAlignment="center"></Label>
        </ng-container>
        *<ng-container *ngIf="changeLanguage">
            <Label text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{'Record Message'| translate}}" class="record-text"  horizontalAlignment="center"></Label>
        </ng-container>
    </ng-container>
    *<ng-container *ngIf="!isClickedRecord">
        <Image src="res://stop_message_enable" class="record-msg" (tap)="startRecordingAnnouncement()"></Image>
        *<ng-container *ngIf="!changeLanguage">
            <Label text=" {{'Stop Recording'| translate}}" class="record-text"  horizontalAlignment="center"></Label>
        </ng-container> 
        *<ng-container *ngIf="changeLanguage">
            <Label text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{'Stop Recording'| translate}}" class="record-text"  horizontalAlignment="center"></Label>
        </ng-container>
    </ng-container>
    *<ng-container *ngIf="isRecordAvailable">
        <Image  src="res://record_message_disable" class="record-msg" ></Image>
        *<ng-container *ngIf="!changeLanguage">
            <Label text=" {{'Record Message'| translate}}" class="record-text" style="color: #5F8193;"  horizontalAlignment="center"></Label>
        </ng-container> 
        *<ng-container *ngIf="changeLanguage">
            <Label text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{'Record Message'| translate}}" class="record-text" style="color: #5F8193;"  horizontalAlignment="center"></Label>
        </ng-container> 
    </ng-container>
</StackLayout>**

But it is working perfectly in Android 9. can anyone please help me out to solve this issue?

大陸北方網友
  • 3,696
  • 3
  • 12
  • 37
hari g
  • 1
  • maybe upgrade your angular version, or use `visibility` (`[hidden]="!myVar"`) instead of `ngIf`. – yaya Aug 20 '20 at 09:33
  • The above method is not working in nativescript. I have tried that earlier. Upgrading the angular doesn't help. Any idea? – hari g Aug 20 '20 at 13:53
  • so search for `nativescript angular visibility`. you'll get results like this one: https://stackoverflow.com/a/48342658/4718434 – yaya Aug 20 '20 at 14:22

0 Answers0