我想创建一个大的UIScrollView
,它的contentView应该包含30多个UIButton
。这些UIButton
的位置不rectiligne,不能创建“programmaticaly”所以我手动放置所有这些UIButton
上UIView
。我放大/ dezoom和滚动都在我的UIScrollView
精细但这里是我的问题:UIButton
屏幕外的创造是无法访问的,我的意思是我不能按他们(仅UIButton
在CGRect(0.f, 0.f, 320.f, 480.f)
创建可点击
任何建议。 ?使用Interface Builder创建UIButton offscreen
回答
创建一个视图,把滚动视图这种观点里面,把你的滚动视图按钮。虽然添加按钮和走动他们,可以肯定,他们总是滚动视图内通过查看接口的对象层次建设者。
可以滑动滚动视图四周,你把东西,没有必要ŧ o放大。只要你的按钮是你的scrollView的孩子,它应该工作得很好。
我的层次结构的UIView - > {UIScrollView中 - > {UIView的 - > {的UIImageView,UIButton的}}}正如我所说的,所有按钮都在这里,但只在离屏幕创建UIButtons不以点击响应。我创建了一个UIView的为我的UIScrollView为了把一个大的UIImageView和我所有的UIButtons,因为我要支持变焦 – klefevre 2011-04-21 12:17:50
好了,我发现我的问题。我UIView至极包含所有我的UIButton和我的UIImageView有320.f,480.f的矩形,并UIButton的屏幕外。我只是把它放到我的UIImageView的大小。这是1500x1500。 thx反正 – klefevre 2011-04-21 12:24:32
很高兴你解决了它。 – 2011-04-21 12:26:49
- 1. 在Interface Builder中使用UIButton创建自定义切换
- 2. 在Interface Builder中创建的UIButton的设置图像,代码
- 3. 我应该清理如果我使用Interface Builder为当Interface Builder中创建了子视图创建视图
- 4. 在Interface Builder中创建游戏精灵?
- 5. IPhone:如何那名在Interface Builder创建
- 6. 如何在Interface Builder中使用自定义的UIButton类别?
- 7. 如何在Interface Builder中使用自定义的UIButton?
- 8. 如何使用Interface Builder在UIButton或UIBarButtonItem上添加BgImage?
- 9. 有效地使用Interface Builder
- 10. 使用Interface Builder for UITableViews
- 11. 使用Interface Builder标记
- 12. iPad:如何使用Interface Builder创建可重复的UI元素?
- 13. iOS - 在运行时使用Interface Builder创建的UIView框架
- 14. 我应该使用Interface Builder来创建表单元吗?
- 15. 创建一个UINavigationController在UITableViewController中使用,而不需要Interface Builder
- 16. 我们是否应该使用Interface Builder来动态创建UI?
- 17. 以编程方式启用/禁用Interface Builder uibutton
- 18. Interface Builder缩放?
- 19. 与Interface Builder中
- 20. Interface Builder编码
- 21. 与Interface Builder中
- 22. Interface Builder + Sprite Strips
- 23. Interface Builder错误?
- 24. 当使用导航控制器时使用Interface Builder创建视图
- 25. 可以Interface Builder中用于创建自定义类实例
- 26. 应用程序使用Interface Builder
- 27. 如何使用Interface Builder在其他UI元素的背景中添加UIButton?
- 28. 如何从Interface Builder中的圆角矩形UIButton继承?
- 29. 如何将自定义UIButton添加到Interface Builder对象库?
- 30. 如何通过Interface Builder在UIButton中保存辅助信息?
该按钮子视图滚动查看或查看?另外为什么UIButton不能以编程方式创建,我不明白原因。 – 0x8badf00d 2011-04-21 10:11:53
我之所以不能在程序上创建它们,是因为位置过于随机。当然,我可以创建一个所有位置的数组,但如果我以前没有找到任何解决方案,我会这样做。 – klefevre 2011-04-21 12:15:11