Image doesn't resize on ActionBar for iOS

ios

#1

Hi!!

I have the following code for the ActionBar

<ActionBar title="" class="action-bar">
    <NavigationButton
        (tap)="toggleDrawer()"
        class="action-bar-item"
        ios:visibility="collapsed" 
        icon="res://menu">
    </NavigationButton>
    <ActionItem 
        icon="res://menu" 
        android:visibility="collapsed" 
        (tap)="toggleDrawer()" 
        ios.position="left">
    </ActionItem>
    <StackLayout class="action-item" android:horizontalAlignment="center" ios:horizontalAlignment="center">
        <Image src="res://ideas_wt_full" width="60%" height="60%" [visibility]="android ? 'visible' : 'collapsed'"></Image>
        <Image src="res://ideas_wt_full" width="30%" height="30%" stretch="aspectFill" [visibility]="!android ? 'visible' : 'collapsed'"></Image>
    </StackLayout>
    <ActionItem android.systemIcon="ic_menu_search" ios.systemIcon="12" ios.position="right"></ActionItem>
</ActionBar>

Everything is fine on Android, but on iOS the image is showing in full resolution so it’s so big for the ActionBar.

Any help is appreciated!!


#2

Try to not use percentage measurements inside the ActionBar. The ActionBar height must be standard across devices, so try setting a fixed height.


#3

Thank you so much, it fixed the issue, I created a class for the image to set the width and height properties. The only thing I needed to take care was of the height for iOS, because it doesn’t change the height of the ActionBar due the limitations with the styles.