首页 \ 问答 \ iOS - 使用StoryBoard创建Popover视图(iOS - Create an Popover View using StoryBoard)

iOS - 使用StoryBoard创建Popover视图(iOS - Create an Popover View using StoryBoard)

大家好,现在我正在尝试使用Xcode故事板创建一个Pop-OverView。 首先,我有

rootViewController, UIViewController, and UITableViewController

我希望UIView充当页面翻转,UITableView将在navigationBar项目控制器下显示popOver。

对于UITableView,我想在NavigationBar控制器下制作Pop-Over。 问题是,当我触摸导航项目以显示UITableViewController时,它显示正确,但是当我尝试关闭Pop-Over View时,它不会关闭。 然后,导航项不能很好地工作。 当我多次触摸它时,它会显示popOverView的多个实例。

这对我来说似乎没有意义。 任何人都可以帮我或告诉我在哪里可以找到关于此的文档/教程?

更新:

对于UIPopOverController,它现在似乎运行良好,但是当我多次触摸导航项时,它仍然在困扰我。 它将显示PopOver的多个实例。 我该如何处理它,它只显示一个实例?


Hi there, Now I'm trying to create a Pop-OverView using an Xcode storyboard. Firstly, I have

rootViewController, UIViewController, and UITableViewController

I want the UIView to act as a page flip and the UITableView will show popOver under the navigationBar item controller.

For the UITableView, I want to make a Pop-Over under NavigationBar controller. The problem is, when I touch the Navigation item to show the UITableViewController, it shows correctly, but when I try to close the Pop-Over View, it won't close. And then, the navigation item doesn't work well. It shows multiple instances of popOverView when I touch it multiple times.

This doesn't seem to make sense to me. Can anyone help me out or tell me where to find documentation / tutorials on this?

UPDATE:

For the UIPopOverController, it seems to work well now, but it is still bugging me when I touch a Navigation Item multiple times. It will show multiple instances of PopOver. How can I handle it, so it will show only one instance?


原文:https://stackoverflow.com/questions/8225589
更新时间:2023-06-28 12:06

最满意答案

您没有在IdFTP.Get调用后重置内存流。 这意味着LoadFromStream调用接收0字节,因此#42错误:

var
  ms1 : TMemoryStream;
  J : TJPEGImage;
  St : String;
begin
  try
    ms1 := TMemoryStream.Create;
    try
      St := 'somepath';
      IdFTP1.Get(St, ms1);
      if ms1.Size > 0 then
      begin
        ms1.Position := 0; // <-- add this
        J := TJPEGImage.Create;
        try
          J.LoadFromStream(ms1);
          Image4.Picture.Graphic := J;
        finally
          J.Free;
        end;
      end;
    finally
      ms1.Free;
    end;
  except
    on E: Exception do
      ShowMessage(E.Message);
  end;
end;

You are not resetting the memory stream after the IdFTP.Get call. This means that the LoadFromStream call receives 0 bytes and hence the #42 error:

var
  ms1 : TMemoryStream;
  J : TJPEGImage;
  St : String;
begin
  try
    ms1 := TMemoryStream.Create;
    try
      St := 'somepath';
      IdFTP1.Get(St, ms1);
      if ms1.Size > 0 then
      begin
        ms1.Position := 0; // <-- add this
        J := TJPEGImage.Create;
        try
          J.LoadFromStream(ms1);
          Image4.Picture.Graphic := J;
        finally
          J.Free;
        end;
      end;
    finally
      ms1.Free;
    end;
  except
    on E: Exception do
      ShowMessage(E.Message);
  end;
end;

相关问答

更多
  • 这样试试,我也是这样改的mysql>update mysql.user set authentication_string=password('123qwe') where user='root' and Host ='localhost';
  • 解 我试图在Adobe Fireworks中打开我的文件( img_myImage.png ),该文件不会打开该文件,因此我在Photoshop中打开了该文件,然后将其重新保存为.png文件,这似乎解决了问题。 SOLUTION I tried opening my file (img_myImage.png) in Adobe Fireworks, which wouldn't open the file, so I opened it in Photoshop which did work, and t ...
  • 造成问题的原因是,当您实例化WindowsPrintConnector ,您需要传入共享打印机的名称: $connector = new WindowsPrintConnector("EPSON TM-T20 Receipt"); 显然,它不能用这个名字。 在https://github.com/mike42/escpos-php/blob/development/example/interface/windows-usb.php#L13-L18上尝试进行故障排除。 The cause of your p ...
  • 从评论中,您似乎正在运行以下内容: dmd -c point.d dmd main.d # presumably contains `import point;` 第一个命令将point.d编译(但不链接)到point.o 。 第二个命令编译并将main.d 和main.d链接到可执行文件中。 它失败并出现“缺少符号”错误,因为DMD不会查找或生成不在其命令行上的任何内容的代码。 当你import points; ,您只导入符号,而不是实际代码。 要解决这个问题,要么...... 与main.d一起编译m ...
  • 它应该如下所示: CREATE TABLE Team ( Team_id INT, Team_name VARCHAR (20), Region VARCHAR (10), League VARCHAR (30), Manager VARCHAR (20), CONSTRAINT PK_Team PRIMARY KEY (Team_id) ); It should look like this: CREATE TABLE Team ( Team_id INT, Team_name VARCHA ...
  • 您没有在IdFTP.Get调用后重置内存流。 这意味着LoadFromStream调用接收0字节,因此#42错误: var ms1 : TMemoryStream; J : TJPEGImage; St : String; begin try ms1 := TMemoryStream.Create; try St := 'somepath'; IdFTP1.Get(St, ms1); if ms1.Size > 0 then b ...
  • 解决了这个问题。 我使用drop命令删除了cache_field表,然后使用下面的命令再次创建表。 CREATE TABLE IF NOT EXISTS `cache_field` ( `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.', `data` longblob COMMENT 'A collection of data to cache.', `expire` int(11) NOT NULL ...
  • 我认为您对文件filgoal.png有问题... C:\ projects \ ZwallU \ app \ build \ res \ all \ debug \ drawable-hdpi \ filgoal.png错误代码:42输出:libpng错误:不是PNG文件 使用编辑器打开它,并保存为选择了PNG。 也许,该文件采用另一种格式,如JPEG。 I think that you have a problem with the file filgoal.png... C:\projects\Zwal ...
  • 尝试把 img.setImageResource(images[cur]); 而不是 ImageViewPic.setImageResource(images[cur]); Try putting img.setImageResource(images[cur]); instead of ImageViewPic.setImageResource(images[cur]);
  • 问题出在这段代码中: def create_new_event(request, steps): if request.method == 'POST': if(steps=="step_1"): stepFirstForm = CreateEventStepFirstForm(request.POST) if stepFirstForm.is_valid(): eventStepFirst = ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)