The specific error message: ArgumentException: Getting control 0’s position in a group with only 0 controls when doing Repaint A
OnGUI will be called two times each time it draws, the first time to calculate the position of all controls, all EdtorGUILayout control method returns the Rect is 0; the second time to draw all the content based on the position, the control method returns the Rect is the actual coordinates.
BeginScrollView to generate a scrolling list, because I need to display a lot of content, so I made an optimization: pre-calculate the position of each line, when the line is in viewport display content, otherwise display blank.
Generic logging found that the height of each row generated by the system is not the same, generally floating randomly between 19-21, so it is impossible to calculate the position of each row, so instead, when the second call to OnGUI, use the Rect returned by the control method to calculate in real time.
Read More:
- Unity Package Webgl Error: Failed running “D:\Program Files\Unity2018.3.0f2\Unity\Editor\Data\PlaybackEngines\Web
- [Solved] Unity Package Error: Failed running D:\Program Files\Unity2018.4.1\Editor\Data\il2cpp/build/il2cpp.exe
- [Solved] MinIO Start Error: “WARNING: Console endpoint is listening on a dynamic port…”
- How to Solve Doris dynamic partition table routineload Error
- [Solved] Unity Error: Assertion failed on expression: ‘IsMatrixValid(matrix)‘…
- std::dynamic_pointer_cast Error: source type is not polymorphic
- [Solved] Mybatis Error: CannotFindDataSourceException: dynamic-datasource can not find primary datasource
- [Solved] Unity Error: Got null handle from IDXGIResource::GetSharedHandle
- [Solved] RuntimeError: each element in list of batch should be of equal size
- [Solved] Unity Publish WebGL Error: Unable to parse Build/webTest2.framework.js.gz
- [Solved] Unity packaged and exported apk error: Failed to load libmain.so’
- [Solved] Zabbix Error: Cannot parse list of active checks
- [Solved] Unity Error: ‘BuildPipeline‘ does not contain a definition for ‘GetBuildTargetName‘
- Unity Error: Asset database transaction committed twice!
- Error in Tensorflow using variables: List of Tensors when single Tensor expected
- [Solved] Unity package Error: CommandInvokationFailure: Gradle build failed.
- How to Solve Error: could not list the contents of folder
- [Solved] Unity Error: “Not allowed to access vertices on mesh”
- [Solved] Unity Package Error: FAILURE: Build failed with an exception.