开发者

How to create multiple labels for iPod Touch

开发者 https://www.devze.com 2022-12-12 00:49 出处:网络
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 d

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

精彩评论

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

关注公众号