使用 UIImage 绘制图块还是使用按钮?

发布于 2024-11-25 23:47:48 字数 778 浏览 0 评论 0原文

我是 IOS 开发的新手,想要创建一些类似于您在这里看到的图块的东西。 http://www.youtube.com/watch?v=i7giaN5T7ww

因为我作为一个初学者,我看到自己在屏幕上放置了一堆按钮,并按照我认为合适的方式标记它们。然后弄清楚如何同时移动多个“按钮”。我想知道您认为这个程序中的图块是如何创建的?如果不是通过一堆按钮完成的,有人可以向我展示代码来绘制尺寸为 48x48 像素的图块,然后在图块上放置一个字母吗?

另外,如果您能给我指出一些有用的资源,帮助我开发类似项目的东西,我将非常感激。我很兴奋也很有动力去学习和掌握 IOS 开发以及 Objective-C。

我的知识仅限于通过观看和编码这两个 YouTube 播放列表所学到的知识:

http://www.youtube.com/user/thenewboston#p/c/640F44F1C97BA581 http://www.youtube.com/user/thenewboston#p/c/53038489615793F7

他们对帮助我了解 Objective-C 和 Iphone 开发的基础知识非常有帮助。不幸的是,它没有涉及在屏幕上绘制和操作对象。

预先感谢您的帮助。我发现这个网站及其用户已经非常有帮助了。 :)

I'm new to IOS development, and want to create something with tiles similar to what you see here. http://www.youtube.com/watch?v=i7giaN5T7ww

Since I'm a beginner, I see myself placing a bunch of buttons on the screen and labeling them to how I see fit. Then figuring out how to move multiple "buttons" at once. I was wondering how you think the tiles are created in this program? If not done by a bunch of buttons, could someone show me code to draw a tile with dimensions of 48x48 pixels, then place a letter on the tile?

Also, if you could point me to some helpful resources that would help me develop something along the lines of a project like this, I would most appreciate it. I'm excited and very motivated to learn and master IOS development and consequently objective-c.

My knowledge is limited to what I've learned by watching and coding along to these two YouTube playlists:

http://www.youtube.com/user/thenewboston#p/c/640F44F1C97BA581
http://www.youtube.com/user/thenewboston#p/c/53038489615793F7

They've been extremely helpful in helping me understand the basics of Objective-C and Iphone development. Unfortunately, it didn't get into drawing and manipulating objects on the screen.

Thanks in advance for your help. I've found this site and its users quite helpful already. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑红尘 2024-12-02 23:47:48

我在应用商店中有一些类似的应用程序,在一种情况下使用了 UILabel,在另一种情况下使用了 UIView,并将 UIImageView 作为子视图。我使用 touchesBegan:withEventtouchesMoved:withEventtouchesEnded:withEvent 方法实现了标签的移动。

I have kind of similar apps in the app store and I used in one case UILabels and in another case UIViews with UIImageViews as subviews. The movement of the labels I have implemented with the methods touchesBegan:withEvent, touchesMoved:withEvent and touchesEnded:withEvent.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文