Scrolling View with Multiple Elements

  1. 3 months ago

    ingurgite

    Aug 13 User since 2018

    Hi,

    I've got a view that basically contains a title, subtitle and some text that could be very long. I would like the whole view to be scrollable, not just the TextView that is long so the experience is smooth.

    How should I do this?

    Thanks

  2. andrea

    Aug 15 Administrator User since 2016
    Edited 3 months ago by andrea

    Hi @ingurgite,
    you could use a container View with the flex layout engine enabled and with the Auto Content Size property set to the Flex value. Then put three Label controls inside the container View, one for the title, one for the subtitle and one with the multiline option flagged for the long text; each one with flex enabled. The content size of the container View will automatically adjust with the space needed by the three inner controls. Just adjust the padding and the margin from the flex inspector of the controls.
    Please see the attached example:
    scrollViewWithFlex.creoproject.zip

    Screenshot 2019-08-15 at 11.02.40.png
    Screenshot 2019-08-15 at 11.02.47.png

  3. 2 months ago

    ingurgite

    Aug 31 User since 2018

    Works great @andrea. Thanks for having taken the time to create an example. I wasn't familiar with Flex.

    As a side note though, I discovered that fonts behave very differently and I don't think this is normal. Please see attached the same kind of example where the content text is in Helvetica Neue. If you change it to Helvetica, it creates a huge padding on top of the text. I don't think this is normal. See screenshots below.

or Sign Up to reply!