简体   繁体   中英

Android drag and drop, endless layout

I want a screen to arrange rectangles with drag & drop. Elements can be moved freely, so it's not a grid or list. I think I should use absolute positions.

My main problem is that I need an endless screen (when drag to right, scroll the screen to the right). One solution I found was to set width and height to 10000dp and a 2d scroll. Another way is to resize the container each time the user drags an element.

I need a better solution if possible. Any suggestions?

范例图片

Resize the container each time the user drags an element out of the current view bounds should be the most performant idea.

By the way you should put some max size limit to the view, otherwise you will run out of RAM fast and your app will crash.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM