# How to create scrollview component using code?

**URL:** <https://forum.playcanvas.com/t/how-to-create-scrollview-component-using-code/13658>\
**Category:** Help & Support\
**Created:** [June 16, 2020, 5:59am UTC](https://forum.playcanvas.com/t/how-to-create-scrollview-component-using-code/13658 "2020-06-16T05:59:53Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Albertos](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/albertos/32/19749_2.png) [@Albertos](https://forum.playcanvas.com/u/Albertos)\
**Post date:** [June 16, 2020, 11:01am UTC](https://forum.playcanvas.com/t/how-to-create-scrollview-component-using-code/13658/10 "2020-06-16T11:01:12Z")

</div>

Maybe this helps:

> [@Creating/displaying scrollview dynamically](https://forum.playcanvas.com/t/creating-displaying-scrollview-dynamically/13523/2):
>
> Hi @Jasont and welcome, Not sure what’s wrong with your code, but a good idea when doing runtime spawning of entities/objects is to prepare them in editor, keep them disabled. On runtime use that as a template/prefab to create a clone and spawn an exact copy of that editor prepared object. var newEntity = prefabEntity.clone(); this.entity.addChild(newEntity); newEntity.enabled = true; Not sure if that will solve your problem, but it can help to easily test where is the issue. If it’s somethi…

---

_[View the full topic](https://forum.playcanvas.com/t/how-to-create-scrollview-component-using-code/13658)._
