harmony 鸿蒙SwipeRefresher

  • 2025-06-12
  • 浏览 (3)

SwipeRefresher

The swipe refresher is a component used to obtain and load content, typically with a pull-down gesture.

NOTE

This component and its child components are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.

Modules to Import

import { SwipeRefresher } from '@kit.ArkUI';

Child Components

Not supported

Attributes

The universal attributes are not supported.

SwipeRefresher

SwipeRefresher ({content?: string, isLoading: boolean})

Decorator: @Component

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.ArkUI.ArkUI.Full

Parameters

Name Type Mandatory Decorator Description
content string No \@Prop Text displayed when the content is loaded.
The default value is an empty string.
NOTE
If the text is longer than the column width, it will be truncated.
isLoading boolean If yes, \@Prop Whether content is being loaded.
The value true means that content is being loaded,
and false means the opposite.

Events

The universal events are not supported.

Example

This example demonstrates how setting the content parameter to empty or non-empty strings and toggling the isLoading parameter between true and false affects the loading effect.

import { SwipeRefresher } from '@kit.ArkUI';

@Entry
@Component
struct Index {
  build() {
    Column() {
      SwipeRefresher({
        content: 'Loading',
        isLoading: true
      })
      SwipeRefresher({
        content: '',
        isLoading: true
      })
      SwipeRefresher({
        content: 'Loading',
        isLoading: false
      })
    }
  }
}

Snipaste_2023-07-24_11-35-40

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArcButton

harmony 鸿蒙ArcSlider

harmony 鸿蒙Chip

harmony 鸿蒙ChipGroup

harmony 鸿蒙ComposeListItem

harmony 鸿蒙ComposeTitleBar

harmony 鸿蒙advanced.Counter

harmony 鸿蒙Dialog Box (Dialog)

harmony 鸿蒙DialogV2

harmony 鸿蒙DownloadFileButton

0  赞