跳至正文

User Interface Customization in iOS 6

Note from Ray: This is the fifth iOS 6 tutorial in the iOS 6 Feast! In this tutorial, we’re updating one of our older tutorials to iOS 6 so it’s fully up-to-date with the latest features like the new UIKit controls that can be customized in iOS 6.

IOS UIView

UIView表示屏幕上的一块矩形区域,它在App中占有绝对重要的地位,因为IOS中几乎所有可视化控件都是UIView的子类。负责渲染区域的内容,并且响应该区域内发生的触摸事件

IOS UILabel UIButton

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 20)];
//设置背景色
label.backgroundColor = [UIColor grayColor];

在Unity3D中使用iPhone原生UI

众所周知, Unity中没有提供UI解决方案, 只能靠第三方的插件来完成. 比较著名的有NGUI等, 但是这种方案不仅需要额外付费(虽然不多), 并且类似NGUI的插件还不那么易用, 使用起来过于复杂.

这里我尝试使用iPhone的原生UI(Cocoa Touch)来作为Unity的UI. 这个听起来似乎很容易的事情, 其实却比我想象的要难的多的多. 主要原因就在于Unity根本就不是想让你这么用的, 3D引擎为了效率, 一般都需要比较专横的占用系统资源, 在本来速度有限的移动平台就更加需要这样了, 这样才能发挥出硬件的极限水平, 制作出更精良的游戏. 鉴于这个原因, 这种方法并不适于性能要求高的游戏.