RN Development FAQ

 

1 How many seconds does the timer call

   Paste the code directly, can be copied and used
    

componentWillUnmount() {
this.timer && clearInterval(this.timer);
}
componentDidMount() {
this.update(this.state.buttonType);
this.timer = setInterval(() => {
this.update(this.state.buttonType)
}, 10000);

}

2 Picture stretch mode 

resizeMode zoom ratio, (including optional three parameters 'cover', 'contain', 'stretch')

  1. The cover mode only seeks to fill the entire display area without distorting the display ratio. The picture can be enlarged or reduced, and the part beyond the display area will not be displayed, that is to say, part of the picture may not be displayed.
  2. The contain mode is required to display the entire picture, it can be scaled down, the picture will be displayed completely, and the background color of the Image control may be exposed. If the width and height of the picture are smaller than the width and height of the control, the picture will not be enlarged.
  3. The stretch mode does not consider maintaining the original width and height ratio of the image. It fills the display area defined by the entire Image. The image displayed in this mode may be deformed and distorted.
  4. The center mode is only supported by the 0.33 version on September 11, and based on the contain mode, it supports proportional enlargement

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324890329&siteId=291194637