내가 동적으로 세 개의 단추와 하나 uitextview을 만드는하지만 난이 프로그램을 실행할 때의 내 화면내 버튼과 textview가 iOS의 화면에 표시되지 않습니까?
당신이 self.view를 할당하는이 내 동적 버튼을 만들 수있는 코드와 텍스트 뷰
-(void)getSmsdisplay
{
self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen]
applicationFrame]];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
UITextView *textview=[[UITextView alloc]init];
[button setTitle:@"Comment" forState:UIControlStateNormal];
[button1 setTitle:@"Share" forState:UIControlStateNormal];
[button1 setTitle:@"Like" forState:UIControlStateNormal];
//listen for clicks
[button addTarget:self
action:@selector(btncomment:)forControlEvents:UIControlEventTouchUpInside];
[button1 addTarget:self
action:@selector(btnShare:)forControlEvents:UIControlEventTouchUpInside];
[button2 addTarget:self
action:@selector(Like:)forControlEvents:UIControlEventTouchUpInside];
smsdata *data=[[smsdata alloc]init];
[textview setText:data.Data];
[self.view addSubview:textview];
//add the button to the view
[self.view addSubview:button];
[self.view addSubview:button1];
[self.view addSubview:button2];
}
입니다 다른 것의 하위보기. – ZeMoon