React NativeScript

React NativeScript

  • Docs

›ELEMENTS: COMPONENTS

INTRODUCTION

  • Introduction

GETTING STARTED

  • Quick Start
  • Environment Setup
  • Using React Devtools

CORE CONCEPTS

  • Native Access
  • Navigation
  • Node Roles
  • Modals
  • Plugins
  • Styling

SAMPLES

  • Apps

ELEMENTS: LAYOUT

  • AbsoluteLayout
  • DockLayout
  • FlexboxLayout
  • GridLayout
  • StackLayout
  • WrapLayout

ELEMENTS: COMPONENTS

  • ActivityIndicator
  • ActionBar
  • ActionItem
  • Button
  • DatePicker
  • Frame
  • HtmlView
  • Image
  • Label
  • ListView
  • ListPicker
  • NavigationButton
  • Page
  • Placeholder
  • Progress
  • ScrollView
  • SearchBar
  • SegmentedBar
  • Slider
  • Switch
  • TabView
  • TabViewItem
  • TextField
  • TextView
  • TimePicker
  • WebView

LICENCES

  • Licences
Edit

Image

<image> is a UI component that shows an image from an ImageSource or from a URL.

See also:

  • Official top-level documentation
  • Detailed API specification

Displaying an image relative to the app directory

import * as React from "react";

<image src="~/logo.png" stretch="none" />

Displaying an image from a URL

import * as React from "react";

<image src="https://art.nativescript-vue.org/NativeScript-Vue-White-Green.png" stretch="none" />

Displaying an image from App_Resources

import * as React from "react";

<image src="res://icon" stretch="none" />

Displaying a base64-encoded image

import * as React from "react";

<image src="data:Image/png;base64,iVBORw..." stretch="none" />

Props

NameTypeDescription
srcstring or ImageSourceGets or sets the source of the image as a URL or an image source.
imageSourceImageSourceGets or sets the image source of the image.
tintColorColor(Style property) Sets a color to tint template images.
stretchStretch(Style property) Gets or sets the way the image is resized to fill its allocated space.
Valid values: none, aspectFill, aspectFit, or fill.
For more information, see Stretch.
loadModeGets or sets the loading strategy for the images on the local file system.
Valid values: sync or async.
Default value: async.
For more information, see loadMode.

Native component

AndroidiOS
android.widget.ImageViewUIImageView
Last updated by Jamie Birch
← HtmlViewLabel →
  • Props
  • Native component
React NativeScript
Docs
Getting StartedUI Components Reference
Community
Stack OverflowChat on Slack in #reactTwitter
More
GitHub – React NativeScriptGitHub – Docs Site
Copyright © 2021 Jamie Birch