开发者

How to create multiple labels for iPod Touch

I want to use two labels on the same view in an iPod Touch application. I have created the two la开发者_JAVA技巧bels, but I only know how to access on of them. Does any one have an example of how to do this?


UILabel *label1 = [[UILabel alloc] initwithFrame: CGRectMake(0,0,100,100)];
UILabel *label2 = [[UILabel alloc] initwithFrame: CGRectMake(0,0,200,200)];

label1.text = @"Label One";
label2.text = @"Label Two";

Or, if you created your labels in Interface builder, make sure you've got IBOutlets for both of them in order to access them from your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜