iOS Code Snippet ImageView Fill (cover) & Fit-Inside (contain)

B4X:
'scale = cover,contain
Public Sub SetImageToImageView(iv As ImageView,bmp As Bitmap, scale As String)
    Dim no As NativeObject=iv
    Select scale
        Case "cover": no.SetField("contentMode",2)
        Case "contain": no.SetField("contentMode",1)
    End Select
    iv.Bitmap = bmp
End Sub

B4A Version
 
Top