<分区>
我正在学习 iOS 开发并尝试制作一个标准的通用“猜词”游戏,该游戏显示几张照片,您需要填写描述这些照片的词。
我查看了应用商店,发现很多游戏都使用相同的 UI 键盘 View 。例如:
我的问题是这种键盘是否有任何开源框架,或者我应该根据字母动态添加一些标签\图像并处理触摸事件并填充字母来构建一个新框架?
最佳答案
创建这样的 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/