Skip to main content
Version: v1.0

QRCODE

The QRCODE widget consists of a QR code and a background (white).

qrcode_sample

Create UI widget

const qrcode = hmUI.createWidget(hmUI.widget.QRCODE, Param)
caution

Amazfit band 7 does not support this widget.

Type

Param: object

PropertiesDescriptionRequiredRequired
contentQR code contentYESstring
xQR Code x CoordinateYESnumber
yQR Code y CoordinateYESnumber
wQR code widthYESnumber
hQR code heightYESnumber
bg_xBackground x coordinatesNOnumber
bg_yBackground y coordinatesNOnumber
bg_wBackground widthNOnumber
bg_hBackground heightNOnumber

Code example

Page({
build() {
const qrcode = hmUI.createWidget(hmUI.widget.QRCODE, {
content: 'Hello Zepp OS',
x: 140,
y: 140,
w: 200,
h: 200,
bg_x: 120,
bg_y: 120,
bg_w: 240,
bg_h: 240
})
}
})