使用 UIImage 绘制图块还是使用按钮?
我是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在应用商店中有一些类似的应用程序,在一种情况下使用了 UILabel,在另一种情况下使用了 UIView,并将 UIImageView 作为子视图。我使用
touchesBegan:withEvent
、touchesMoved:withEvent
和touchesEnded:withEvent
方法实现了标签的移动。I have kind of similar apps in the app store and I used in one case
UILabel
s and in another caseUIView
s withUIImageView
s as subviews. The movement of the labels I have implemented with the methodstouchesBegan:withEvent
,touchesMoved:withEvent
andtouchesEnded:withEvent
.