【发布时间】:2014-10-14 09:38:07
【问题描述】:
我想在我的 UILabel 中添加第二行,但我不知道将代码放在哪里,没有它我就被困住了。 #导入
@interface ViewController : UIViewController{
IBOutlet UITextField *TramNumber;
IBOutlet UILabel *Tramresult;
}
- (IBAction)Button:(id)sender;
- (IBAction)DismissKeyboard;
@end
这是我的 ViewController.h 中的代码,Tramresult 是我的 UILabel。
【问题讨论】:
-
小注释、属性和方法不应该以大写字母开头。其次,您要将
UILabel的numberOfLines设置为 2 表示到行或 0 表示无限行。 -
这个设置可以在XIB中进行——它不必是动态的。
标签: ios objective-c xcode xcode5.1