question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Icon size won't animate

See original GitHub issue

Hello,

as described in the title I can’t animate the icon’s size.

I create an AnimatedIcon, then I try to animate it with interpolate on the selected variable which is a boolean. If the initial selected value is 1 then the Icon is bigger (40) but transition between 1 and 0 is not animated and the reverse transition (1 to 0) never animates, icon stays small (30).

var size = selected.interpolate({ inputRange: [0, 1], outputRange: [30, 40], });

I tried animating the size prop as well as the fontSize style prop. Any idea on how to do this ?

NB: animating color the same way works very well.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
obladorcommented, Apr 2, 2017

@mdramos Does my example work for you? Did you try using style={{ fontSize: xx}}?

1reaction
obladorcommented, Mar 13, 2016

It works, I’m guessing you’ve forgotten to call start() on your animation. Try this simple example:

this.state = {
    size: new Animated.Value(20)
};

<TouchableOpacity onPress={() => Animated.spring(this.state.size, { toValue: 40 }).start()}>
    <AnimatedIcon name="heart" style={{ fontSize: this.state.size }} />
</TouchableOpacity>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Decrease Toolbar Icon Size in Adobe Animate
Try right-clicking on your desktop, then go to Display Settings > Video > Change the size of text, apps, and other items and...
Read more >
Icons not Appearing and Animation not Working - Stack Overflow
I'm trying to use icons from fontawesome ...
Read more >
Reduce the size of an icon during the animation
This tutorial will demonstrate how to reduce the size of an Icon during CSS Animations.
Read more >
Creating Icons for Mobile Apps in Adobe Animate - YouTube
Learn how to create and add icons to the apps you have created in Adobe Animate. You simply use Fireworks, Photoshop or some...
Read more >
Can't move desktop icons in Windows 11/10
Changing the scaling size for text, apps, and other things might also help in fixing this issue. Open the Settings app and access...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found