-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with dequeueing cells in RightMenuViewController #836
Comments
@kambala-decapitator, to me it looks like 6e315fd and/or c6c51a7 caused this. Can you help me understand what is the difference between the following implementations in detail? It seems that the old implementation enforced a clean assignment of the custom button cell each time by old (working):
new (issues):
Edit: What also works is enforcing reloading the cell each time by simply removing the condition:
Edit2: This also works.
|
Looked into this further. As already suspected the problem was finally introduced when I removed the additional |
FYI you could've used in all the snippets dequeuing a cell and then immediately replacing it with a new object looks strange as it basically kills the whole purpose of cell recycling/reusing. But if you found a workaround, let's try it, although in the end all such code should be refactored to work properly. |
Thanks, this confirms my thoughts. It means the old implementation (App version 1.11 or earlier) did in fact never use the dequeued cells for the power menu or any of the custom buttons. Dequeueing only was effective for a subset of the cells (only iPhone, new iPhones: server status, old iPhone with small display: server status, volume slider, keyboard, gesture toggle, help, LED torch). |
Next issue which I need to handle is solved in #838. In this case I assume the best will be to create different cell layouts and introduce dequeueing for each of them to avoid re-creation each time, but at the same time avoid mixing the types which obviously causes auto layout issues. This could look something like this:
|
yes, in general your proposal is correct. But to be more technical, the code would be slightly different:
|
Thank you for providing the update on your progress with resolving the layout issue in your iOS app. It sounds like you have identified a solution involving creating separate cell layouts and using dequeueing to avoid re-creation each time, while also avoiding mixing the types to prevent auto layout issues. The code snippet you provided looks like a good starting point for implementing this solution. You could create separate cell classes for each type of layout you need, and then use the appropriate class based on the type of data you are displaying in the cell. The dequeue() method could be used to obtain an existing cell of the appropriate class, or create a new cell if one does not exist. To further optimize performance, you could also consider implementing reuse identifiers for each cell class to improve the efficiency of the dequeueing process. I hope this helps, and please let me know if you have any additional questions or concerns. |
Since #768 the App faces problems when sending it to sleep and resume again. #811 aimed to fix this with setting the layout freshly for each call. Still the App faces layout issues after sleep/resume.
The problem becomes visible when having 5 or more custom buttons, including 1 custom button with a one-off switch. How to reproduce:
Worse:
The text was updated successfully, but these errors were encountered: