iPhone中的Popover视图

iPhone中的Popover视图,iphone,view,scrollview,popover,Iphone,View,Scrollview,Popover,我在UIView上添加了一个垂直滚动视图。然后将下面链接中的一些“中右”按钮添加到滚动视图中 当我单击滚动视图中的一个“中右”按钮时,会出现一个弹出窗口“tableview”。当我单击表视图的一行,并在弹出框外单击时,弹出框将关闭 如何实现这样的效果,当我单击表视图的一行时,可以根据行的标记将图像添加到滚动视图的UIView中 提前谢谢 您可以从DemoTableController类和委托方法-didSelectRowAtIndexPath获取selectedRaw编号您可以获取标签或原始编号

我在UIView上添加了一个垂直滚动视图。然后将下面链接中的一些“中右”按钮添加到滚动视图中

当我单击滚动视图中的一个“中右”按钮时,会出现一个弹出窗口“tableview”。当我单击表视图的一行,并在弹出框外单击时,弹出框将关闭

如何实现这样的效果,当我单击表视图的一行时,可以根据行的标记将图像添加到滚动视图的UIView中


提前谢谢

您可以从
DemoTableController
类和委托方法
-didSelectRowAtIndexPath
获取selectedRaw编号您可以获取标签或原始编号,如下图所示

#import "FPViewController.h"
只需导入
demobileController.m
中的
FPViewController.h
文件,如下面所示

#import "FPViewController.h"
然后下面这个方法调用这个

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
       int TagNo = indexPath.row;
       NSLog("\n Row No. : %d",TagNo);
       FPViewController *objFPView= [[ FPViewController alloc]init];
      [objFPView AddImageWithTag:TagNo];
}
FPViewController.h
文件中创建一个方法,如下所示

-(void)AddImageWithTag:(int)tag;
在'FPViewController.m'中

-(void)AddImageWithTag:(int)tag{
    NSLog(@"\n\n Tag Number : %d",tag);
}

我希望这对您有所帮助…

您可以从
DemoTableController
类和委托方法
-didSelectRowAtIndexPath
中获取selectedRaw编号您可以获取标签或原始编号,如下图所示

#import "FPViewController.h"
只需导入
demobileController.m
中的
FPViewController.h
文件,如下面所示

#import "FPViewController.h"
然后下面这个方法调用这个

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
       int TagNo = indexPath.row;
       NSLog("\n Row No. : %d",TagNo);
       FPViewController *objFPView= [[ FPViewController alloc]init];
      [objFPView AddImageWithTag:TagNo];
}
FPViewController.h
文件中创建一个方法,如下所示

-(void)AddImageWithTag:(int)tag;
在'FPViewController.m'中

-(void)AddImageWithTag:(int)tag{
    NSLog(@"\n\n Tag Number : %d",tag);
}
我希望这能帮助你……

使用

它可能有助于您使用


这可能对你有帮助。

我以前注意到过这个演示,不管怎样,谢谢你的及时回复!我已经注意到这个演示之前,感谢您的及时回复无论如何!谢谢你的及时回复!实际上,我将FPPopover项目集成到了从以下位置下载的“Scroller”项目中:项目文件下载2011年2月更新的项目文件:iPhone iOS 4.x Projects v1.1.zip(2011年2月发布),我将您建议中的所有“FPViewController”更改为“ScrollServiceController”,只是想测试一下,在滚动条应用程序的UIView中添加一个图像,而不涉及行数。但未能将图像添加到滚动程序应用程序的UIView。“-(void)tableView:(UITableView*)tableView DidSelectRowatineXpath:(NSIndexPath*)indexPath{int TagNo=indexPath.row;ScrollServiceWController*objFPView=[[ScrollServiceWController alloc]init];UIImage*image1=[UIImage ImageName:@“Checkers.png”];UIImageView*imageView=[[UIImageView alloc]initWithImage:image1];//[self.view addSubview:imageView];//这将图像添加到tableview本身,而不是我想要实现的滚动程序项目的UIView。[objFPView addSubview:imageView];}'您获得日志并手动添加图像只需在AddImageWithTag方法上添加图像,我不明白您为什么将FPView更改为scrollview哦,杜德只需尝试添加类似于-(void)AddImageWithTag:(int)标记{NSLog(@“\n\n标记号:%d”,标记);[scrollview addSubview:imageView];}感谢您的及时回复!事实上,我已将FPPopover项目集成到“Scroller”项目中,该项目从以下位置下载:项目文件下载2011年2月更新的项目文件:iPhone iOS 4.x Projects v1.1.zip(2011年2月发布),我已将您建议中的所有“FPViewController”更改为“ScrollServiceController”,只想测试向滚动程序应用程序的UIView添加一个与行数无关的图像。但未能向滚动程序应用程序的UIView添加图像。“-(void)tableView:(UITableView*)tableView DidSelectRowatineXpath:(NSIndexPath*)indexPath{int TagNo=indexPath.row;ScrollServiceWController*objFPView=[[ScrollServiceController alloc]init];UIImage*image1=[UIImage ImageName:@“Checkers.png”];UIImageView*imageView=[UIImageView alloc]initWithImage:image1];//[self.view addSubview:imageView];//这将图像添加到tableview本身,而不是我想要实现的Scroller项目的UIView。[objFPView addSubview:imageView];}如果你得到了日志并手动添加了图像,只需在AddImageWithTag方法上添加图像,我不明白为什么你要将FPView更改为scrollview哦,杜德只需尝试在-(void)AddImageWithTag:(int)标记{NSLog(@“\n\n标记号:%d”,标记);[scrollview addSubview:imageView];}