• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

创建如iPhone主屏幕的图标网格

用户头像
it1352
帮助1

问题说明

如何在iPhone上创建类似于Springboard(主屏幕)的UI?我想要一个网格的均匀间隔的按钮,其中我可以响应按钮点击。

How should I go about creating a UI similar to the Springboard (home screen) on the iPhone? I'd like a grid of evenly spaced buttons with images where I can respond to the button tap.

UITable是否适合?我应该使用一个简单的UIView并在DrawRect中手动定位图标?有没有可以自动均匀分布按钮,允许重新组织,并根据iPhone方向调整布局的替代方法?

Is the UITable a good fit? Should I use a plain UIView and position the icons manually in DrawRect? Is there an alternative that will automatically evenly space the buttons, allow reorganization, and adjust the layout according to the iPhone orientation?

我来自一个C#/ Winforms背景和

I come from a C#/Winforms background and am just now starting iPhone development on the Open Toolchain with 2.2.1 headers.

正确答案

#1

您需要添加您的图标(这是UIViews作为你的跳板视图的子视图。不需要自定义绘图,UITable是绝对错误的方式去。你只需要做正确的数学(通过设置他们的框架)。

You need to add your icons (which are UIViews of some sort) as subviews of your "Springboard" view. No custom drawing needed, and a UITable is thh absolute wrong way to go. You just need to do the math to place them correctly (by setting their frame).

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcgkhak
系列文章
更多 icon
同类精品
更多 icon
继续加载