久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='4A8F5'><style id='4A8F5'><dir id='4A8F5'><q id='4A8F5'></q></dir></style></legend>
  • <tfoot id='4A8F5'></tfoot>
      <bdo id='4A8F5'></bdo><ul id='4A8F5'></ul>
  • <i id='4A8F5'><tr id='4A8F5'><dt id='4A8F5'><q id='4A8F5'><span id='4A8F5'><b id='4A8F5'><form id='4A8F5'><ins id='4A8F5'></ins><ul id='4A8F5'></ul><sub id='4A8F5'></sub></form><legend id='4A8F5'></legend><bdo id='4A8F5'><pre id='4A8F5'><center id='4A8F5'></center></pre></bdo></b><th id='4A8F5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4A8F5'><tfoot id='4A8F5'></tfoot><dl id='4A8F5'><fieldset id='4A8F5'></fieldset></dl></div>

      <small id='4A8F5'></small><noframes id='4A8F5'>

        React Native:如何為圖像的旋轉(zhuǎn)設(shè)置動(dòng)畫?

        React Native: How do you animate the rotation of an Image?(React Native:如何為圖像的旋轉(zhuǎn)設(shè)置動(dòng)畫?)
            <legend id='80hMg'><style id='80hMg'><dir id='80hMg'><q id='80hMg'></q></dir></style></legend>

            <tfoot id='80hMg'></tfoot>
                <tbody id='80hMg'></tbody>

              <i id='80hMg'><tr id='80hMg'><dt id='80hMg'><q id='80hMg'><span id='80hMg'><b id='80hMg'><form id='80hMg'><ins id='80hMg'></ins><ul id='80hMg'></ul><sub id='80hMg'></sub></form><legend id='80hMg'></legend><bdo id='80hMg'><pre id='80hMg'><center id='80hMg'></center></pre></bdo></b><th id='80hMg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='80hMg'><tfoot id='80hMg'></tfoot><dl id='80hMg'><fieldset id='80hMg'></fieldset></dl></div>

              <small id='80hMg'></small><noframes id='80hMg'>

                  <bdo id='80hMg'></bdo><ul id='80hMg'></ul>
                  本文介紹了React Native:如何為圖像的旋轉(zhuǎn)設(shè)置動(dòng)畫?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  旋轉(zhuǎn)是一種樣式變換,在 RN 中,您可以像這樣旋轉(zhuǎn)東西

                  Rotation is a style transform and in RN, you can rotate things like this

                    render() {
                      return (
                        <View style={{transform:[{rotate: '10 deg'}]}}>
                          <Image source={require('./logo.png')} />
                        </View>
                      );
                    }
                  

                  但是,要在 RN 中制作動(dòng)畫,您必須使用數(shù)字,而不是字符串.你還能在 RN 中為變換設(shè)置動(dòng)畫,還是我必須想出某種 sprite sheet 并以某些 fps 更改 Image src?

                  However, to animate things in RN, you have to use numbers, not strings. Can you still animate transforms in RN or do I have to come up with some kind of sprite sheet and change the Image src at some fps?

                  推薦答案

                  您實(shí)際上可以使用 interpolate 方法為字符串設(shè)置動(dòng)畫.interpolate 采用一系列值,通常 0 到 1 適用于大多數(shù)情況,并將它們插入到一系列值中(這些可以是字符串、數(shù)字,甚至是返回值的函數(shù)).

                  You can actually animate strings using the interpolate method. interpolate takes a range of values, typically 0 to 1 works well for most things, and interpolates them into a range of values (these could be strings, numbers, even functions that return a value).

                  你要做的是獲取一個(gè)現(xiàn)有的 Animated 值并將其傳遞給 interpolate 函數(shù),如下所示:

                  What you would do is take an existing Animated value and pass it through the interpolate function like this:

                  spinValue = new Animated.Value(0);
                  
                  // First set up animation 
                  Animated.timing(
                      this.spinValue,
                    {
                      toValue: 1,
                      duration: 3000,
                      easing: Easing.linear, // Easing is an additional import from react-native
                      useNativeDriver: true  // To make use of native driver for performance
                    }
                  ).start()
                  
                  // Next, interpolate beginning and end values (in this case 0 and 1)
                  const spin = this.spinValue.interpolate({
                    inputRange: [0, 1],
                    outputRange: ['0deg', '360deg']
                  })
                  

                  然后像這樣在你的組件中使用它:

                  Then use it in your component like this:

                  <Animated.Image
                    style={{transform: [{rotate: spin}] }}
                    source={{uri: 'somesource.png'}} />
                  

                  如果你想在循環(huán)中進(jìn)行旋轉(zhuǎn),那么在 Animated.loop

                  In case if you want to do the rotation in loop, then add the Animated.timing in the Animated.loop

                  Animated.loop(
                   Animated.timing(
                     this.spinValue,
                     {
                      toValue: 1,
                      duration: 3000,
                      easing: Easing.linear,
                      useNativeDriver: true
                     }
                   )
                  ).start();
                  

                  這篇關(guān)于React Native:如何為圖像的旋轉(zhuǎn)設(shè)置動(dòng)畫?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請(qǐng)求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                • <small id='47DKZ'></small><noframes id='47DKZ'>

                    <legend id='47DKZ'><style id='47DKZ'><dir id='47DKZ'><q id='47DKZ'></q></dir></style></legend>

                      <i id='47DKZ'><tr id='47DKZ'><dt id='47DKZ'><q id='47DKZ'><span id='47DKZ'><b id='47DKZ'><form id='47DKZ'><ins id='47DKZ'></ins><ul id='47DKZ'></ul><sub id='47DKZ'></sub></form><legend id='47DKZ'></legend><bdo id='47DKZ'><pre id='47DKZ'><center id='47DKZ'></center></pre></bdo></b><th id='47DKZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='47DKZ'><tfoot id='47DKZ'></tfoot><dl id='47DKZ'><fieldset id='47DKZ'></fieldset></dl></div>
                          <tbody id='47DKZ'></tbody>

                            <bdo id='47DKZ'></bdo><ul id='47DKZ'></ul>
                          • <tfoot id='47DKZ'></tfoot>
                            主站蜘蛛池模板: 日日操夜夜摸 | 欧美一二区 | 欧美日韩视频 | 欧美日韩精品一区二区三区四区 | 日韩精品一区在线 | 国产一区二区电影 | 日本一区二区高清不卡 | 国产精品毛片在线 | 久久伊人精品一区二区三区 | 日本激情一区二区 | 精品在线一区二区 | 亚洲一二三区不卡 | 在线播放中文字幕 | 在线欧美视频 | 国产精品成人在线 | 密桃av| 久久久亚洲精品视频 | 午夜精品久久久久久久久久久久久 | 久草精品视频 | 久久久久久黄 | 麻豆精品一区二区三区在线观看 | 欧美精品在欧美一区二区少妇 | 黄色三级毛片 | 99久久精品免费看国产免费软件 | 日韩成人免费av | 精品粉嫩aⅴ一区二区三区四区 | 99久久婷婷国产亚洲终合精品 | 亚洲日韩中文字幕一区 | 米奇狠狠鲁 | av在线播放网站 | www.色综合 | 日韩一级精品视频在线观看 | 狠狠亚洲| 精产国产伦理一二三区 | 9999在线视频| 国产欧美日韩久久久 | 欧美男人天堂 | 日韩欧美在线视频一区 | 资源首页二三区 | 国产欧美一级二级三级在线视频 | 免费看国产片在线观看 |