Adaptive Layout

Last Updated on : 2021-08-27 11:07:18download

TYIpcLayoutAtuo supports an adaptive content layout based on the relative height of the content and container. The following rules are supported:

  • When the height of the container is greater than or equal to the height of the content, the layout is horizontally and vertically centered.
  • When the height of the container is smaller than the height of the content, the content is scrolled.

Preview

Adaptive Layout

Properties

Field name Type Description Default value
containerHeight number The height of the container. 100
containerStyle ViewStyle The style of the container. {}
mainContentStyle ViewStyle The style of the content container. {}
scrollProps object The attributes supported by ScrollView. {}
children Component Any custom child component. null

Example

import { TYIpcLayoutAtuo } from '@tuya/tuya-panel-ipc-sdk';
...

 const containerLargeHeight = 300;
 
  <View style={{ height: containerLargeHeight}} >
          <TYIpcLayoutAuto containerHeight={containerLargeHeight}>
           // The custom child component.
           <Example />
           </TYIpcLayoutAuto>
  </View>