开发者

how to add the buttons to the popover view in ipad app

i want to add some text fields and the buttons to the popover view ...

how to add those and i hav to read the text added into text field by user later ...

.开发者_如何学C...should i need seperate view controller class to control popover view or can i control with existed one which calls popover view....

any help Appreciated..


Create a UIViewController using IB or programatically. Add needed buttons, textfields and maybe some logic there and use this viewController for initializing an UIPopoverController (as Gendolkari suggested).


The UIPopoverView is created by passing in a ViewController which controls the content of your popover. Check out the initWithContentViewController:, this allows you to pass your own ViewController. That ViewController would have a view with the text fields and button that you want.


Try using this:

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[button addTarget:self 
        action:@selector(aMethod:)
        forControlEvents:UIControlEventTouchDown];

[button setTitle:@"Show View" forState:UIControlStateNormal];

button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);

[self.tableView addSubview:button];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜