0
ラベルを動的に追加する必要があるアプリケーションを作成する必要があります。iPadでラベルを動的に追加する方法
ラベルを動的に追加する必要があるアプリケーションを作成する必要があります。iPadでラベルを動的に追加する方法
- (void)addLabelWithText: (NSString*)text toView: (UIView*)view withFrame: (CGRect)frame {
UILabel *label = [[UILabel alloc] initWithFrame: frame];
[label setText: text];
[view addSubview: label];
[label release];
}
そしてどこか、あなたのViewControllerで:
[self addLabelWithText: @"Cool Label" toView: [self view] withFrame: CGRectMake(0.0f, 0.0f, 200.0f, 200.0f)];