scroll rect not smooth in mobile device ios

I want to make scroll rect to smooth and best performance.

Can you advice me ?

A few things here. I think you should revert to the default ScrollView
This sets up the ScrollView portion, then a child ‘ViewPort’, then a child “content” (whose children are your actual content).
On the content you can put the content size fitter & layout group (but don’t on its parent(s)).

After that, can you explain what you mean by smooth? What’s it doing now that you don’t like? Did you adjust any of the elastic values or try the ‘clamped’ option? Is that what you meant?

I want to make game for ios. Clamp or elastic which is best choice ?

You can use either, but elastic is more ios’s style.

as for “smooth” do you mean performance? if so one thing you can do is subdivide your ui into multiple nested canvas. if a UI moves or animates color, wrap it inside a canvas. the way the UI works is that if it detects a change it redraws all elements inside that canvas that the overlap where the change happened. if you have 10 buttons and you click on one (changing the buttons color) that graphic has changed and unity will redraw all elements in that canvas which overlap with the button. But if you wrap each button in its own canvas then only that button will get redrawn.

also, make sure all your elements are on the same plane, and Canvas overlay mode is the most performant of all the render modes. when you apply a 3rd dimension to the canvas the UI thread has to do extra math and is forced to always redraw the entire canvas, having the canvas use the camera brings even more overhead because now the UI thread has to wait for information from the camera (which is on a different thread) before it can complete its drawing of the canvas

Can’t add anything beyond what’s already said. Hope you find something that works nicely for you :slight_smile:

Kurt-Dekker’s answer helped me in the Make scrolling move faster in scrollRect?

Similar problem here. We are using Unity’s default UI ScrollView and on iPhone it is a bit jerky (on android the scrolling is very smooth, on iPhone the scrolling looks like it is running with 10 fps)
Anyone knows something about this issue?
(Unity 2018.3.3)

Default ScrollRect is not scrolling smooth on Android and iOS.
Not like scrolling in Instagram, for example.
This is still true on 2019.2. 20f1
Does anyone have a solution or ideas?

6 Likes
1 Like

I’ve been having the same problem for years. I remember it was a problem on Unity 5, and it still is on the current most recent LTS: 2020.3

On very old Android devices the scroll view has always been silky smooth, but on even the latest iPhone it looks painfully juddery, to the point it makes me feel I need to rethink using Unity for my project, as it has quite a focus on scrolling.

Thanks @thientv84 - I’ll try some of these optimisations, but I feel that considering the lower powered Android devices work fine that it is actually an issue with Unity and something we shouldn’t be having to implement several workarounds for.

Hi guys! I had the same problem on ios, but I found the solution and it’s very simple. Just run a script on any object (camera or manager) limiting fps to 60

using UnityEngine;

public class FPS : MonoBehaviour
{
    void Start()
    {
        Application.targetFrameRate = 60; // Or Application.targetFrameRate = Screen.currentResolution.refreshRate;
    }

}
1 Like

Thanks @Sicvent . I had same issue and this solved it.

Does anyone know how it works with addaptive frame rate screens, for the devices like iPhone 13 and later? Same with Android devices supporting this feature.
I was testing on iPhone 13 Pro Max and before changing the Application.targetFrameRate manually UI scrolling was soo laggy, as topic caster said - same as 10FPS.
After checking the solution provided above and setting frame rate to 30 or 60 it became smooth. Default frame rate was set to -1, what means it will be set according to device frame rate.

From what I understand, if I leave frame rate at default -1, the device just don’t recognize, when exactly it should raise up frame rate for smooth experience. Why so? Is it Unity issue it doesn’t “notify” device or something else?
For now I see the only one workaroung here to keep power consumption as low as possible but don’t let the UI lag - adjust the frame rate manually when user starts some frame rate sensetive tasks, like start dragging, scrolling, etc… The simpliedied version of this approach - adjust frame rate according to active UI screen. For example, on the screen without scroll rect, we can keep it -1, but if scroll rect exists - 30 or 60.

Any better ideas?