无限文档的滚动条? [英] Scrollbars for Infinite Document?

查看:110
本文介绍了无限文档的滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个标准的Aqua方式来处理一个几乎无限的文档吗?

Is there a standard Aqua way to handle a practically infinite document?

例如,想象一个基于瓦片的游戏的关卡编辑器。该级别没有预设大小(尽管它在技术上受限于 NSInteger 的大小);瓷砖可以放置在网格上的任何位置。有滚动这样的文档的标准界面吗?

For example, imagine a level editor for a tile-based game. The level has no preset size (though it's technically limited by NSInteger's size); tiles can be placed anywhere on the grid. Is there a standard interface for scrolling through such a document?

我不能简单地限制滚动到已经有瓷砖的区域,因为用户需要能够在该边界外添加瓦片。

I can't simply limit the scrolling to areas that already have tiles, because the user needs to be able to add tiles outside that boundary. Arbitrarily creating a level size, even if it's easily changeable by the user, doesn't seem ideal either.

任何人都看过处理这个问题的应用程序?

Has anyone seen an application that deals with this problem?

推荐答案

一个选项是在用户滚动区域时实际动态扩展区域 - 任何时候用户在边缘的X个单位内滚动,在该方向上添加另一个单位。基本上,你永远无法滚动到边缘,因为越接近它会扩展。

One option is to essentially dynamically expand the area as the user scrolls through it - any time the user scrolls within X units of an edge, add another unit in that direction. Essentially, you'll never be able to scroll "all the way" to an edge, because the closer you get the farther it will expand.

如果用户向后滚动远离边缘,收缩回不超过实际内容的地方超过X个单位。

If the user scrolls back away from the edge, contract it to back to no more than X units beyond where there is actually content.

这篇关于无限文档的滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆