使用UITableView的UIAtionSheet(UIAtionSheet with UITableView)

我需要一些关于UIActionSheet的建议。 在我的例子中,我创建了一个ActionSheet,其中我正在显示带有一些数据的UITableView。

UIActionSheet *asheet = [[UIActionSheet alloc] init]; [asheet showInView:self.view]; [asheet setFrame:CGRectMake(0, 250, 320, 320)]; CustomView *innerView = [[CustomView alloc] initWithNibName:@"CustomView" bundle:nil]; innerView.view.frame = CGRectMake(0, 10, 320, 210); [asheet addSubview:innerView.view];

CustomView包含表。 数据显示正确,它显示3行,现在我想要一些类似的功能,如: (1)当我点击任何一行时,所选行应位于中心。 (2)我应该在CustomView或ActionSheet中添加按钮(完成,取消)的位置? (3)当我点击完成按钮时如何获得所选行?

有什么建议么 ?

谢谢..

I need some suggestions about UIActionSheet. In my case I have created an ActionSheet in which I am displaying the UITableView with some data.

UIActionSheet *asheet = [[UIActionSheet alloc] init]; [asheet showInView:self.view]; [asheet setFrame:CGRectMake(0, 250, 320, 320)]; CustomView *innerView = [[CustomView alloc] initWithNibName:@"CustomView" bundle:nil]; innerView.view.frame = CGRectMake(0, 10, 320, 210); [asheet addSubview:innerView.view];

the CustomView contains the table . Data is displaying properly, it displays exact 3 rows, now I want some similar functionality like : (1) when I click on any row, the selected row should come at center. (2) and where should I add buttons (done , cancel) in CustomView or in ActionSheet ? (3) and how I get the selected row when I click on Done button?

any suggestions ?

Thanks..

最满意答案

(1)

当我点击任何一行时,所选行应位于中心。

请向我提供有关此问题的更多详细信息,我无法做到正确。

(2)

我应该在CustomView或ActionSheet中添加按钮(完成,取消)的位置?

在UIActionSheet中添加它们:

UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"Destructive Button" otherButtonTitles:@"Other Button 1", @"Other Button 2", nil]; popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque; [popupQuery showInView:self.view]; [popupQuery release];

(3)

点击完成按钮后获取所选行?

NSIndexPath *indexPath = [MyTableView indexPathForSelectedRow]

(1)

when I click on any row, the selected row should come at center.

Kindly provide me with more details on this issue i can't get it right.

(2)

and where should I add buttons (done , cancel) in CustomView or in ActionSheet ?

Add them in the UIActionSheet:

UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"Destructive Button" otherButtonTitles:@"Other Button 1", @"Other Button 2", nil]; popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque; [popupQuery showInView:self.view]; [popupQuery release];

(3)

get the selected row when I click on Done button?

NSIndexPath *indexPath = [MyTableView indexPathForSelectedRow]

更多推荐