- Home /
Layout Element required for scroll views but only on Android
Hi all,
My UI contains a scroll rect, with a vertical layout group on it's child. The layout group doesn't contain anything in the editor; when I run the app some objects get instantiated in code and added to the group. This works fine in the editor but when I run on android the contents of the group aren't visible, unless I also add a layout element with a minimum height to the scroll rect.
I don't want to specify a minimum height if I can avoid it, I want the group to fill it's rect transform, exactly as it does in the editor, which works even without the minimum height.
Oddly I found this is only a problem if I run my script which instantiates my objects when the app first launches. If I delay it at all, it works perfectly. Ideally I would like to know what I'm doing wrong rather than rely on something like that.