ios - 猜字游戏的股票代码/框架-键盘 UIView

标签 ios iphone uiview

<分区>


想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它.

关闭 7 年前

我正在学习 iOS 开发并尝试制作一个标准的通用“猜词”游戏,该游戏显示几张照片,您需要填写描述这些照片的词。

我查看了应用商店,发现很多游戏都使用相同的 UI 键盘 View 。例如:

enter image description here

我的问题是这种键盘是否有任何开源框架,或者我应该根据字母动态添加一些标签\图像并处理触摸事件并填充字母来构建一个新框架?

最佳答案

创建这样的 View 并不是特别困难。这是一个简单的 View 层次结构,在固定位置有 13 个按钮。

将其用作学习练习并自己实现,您可以在 Interface Builder 中将其作为一个 nib,一个自定义的 UIView 子类,带有一个很好的委托(delegate)接口(interface),如下所示:

@protocol GameKeyboardDelegate

// Called when a letter button is tapped
- (void)gameKeyboard:(GameKeyboard *)keyboard tappedKeyWithName:(NSString *)keyName;

// Called when the bomb button is tapped
- (void)gameKeyboardTappedBomb:(GameKeyboard *)keyboard;

// Provided to let your game logic determine whether or not the bomb button should be enabled.
- (BOOL)gameKeyboardShouldEnableBombButton:(GameKeyboard *)keyboard;

@end

关于ios - 猜字游戏的股票代码/框架-键盘 UIView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33009638/

上一篇:ios - 覆盖 swift 2.0 和 xcode 7 代码后 UITableView 中的空白行

下一篇:ios - 播放音频文件到 iOS 模拟器麦克风

相关文章:

ios - AFNetworking iOS 添加 curl

ios - 给 UITextField 赋值时 UIView 下移

ios - iOS 7 中的屏幕截图

objective-c - ualarm() 的 iOS( Objective-C )版本

ios - CLLocationManagerDelegate-locationManager(_ :startMonitoring:) not called when there is no network

iphone - 无法在 Instruments : At least one target failed to launch 中启动我的应用程序

ios - Swift 3 向 UIView 的边缘之一添加自定义边框

ios - 无法将 UTC 时间转换为本地时间?

ios - 相机节点随着 iOS 设备的移动而旋转

c# - 使用 Xamarin/C# 开始 iOS 开发的最佳方式是什么?