pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<tfoot id='7OVLR'></tfoot>
        <legend id='7OVLR'><style id='7OVLR'><dir id='7OVLR'><q id='7OVLR'></q></dir></style></legend>
        <i id='7OVLR'><tr id='7OVLR'><dt id='7OVLR'><q id='7OVLR'><span id='7OVLR'><b id='7OVLR'><form id='7OVLR'><ins id='7OVLR'></ins><ul id='7OVLR'></ul><sub id='7OVLR'></sub></form><legend id='7OVLR'></legend><bdo id='7OVLR'><pre id='7OVLR'><center id='7OVLR'></center></pre></bdo></b><th id='7OVLR'></th></span></q></dt></tr></i><div class="22e0oey" id='7OVLR'><tfoot id='7OVLR'></tfoot><dl id='7OVLR'><fieldset id='7OVLR'></fieldset></dl></div>
      1. <small id='7OVLR'></small><noframes id='7OVLR'>

          <bdo id='7OVLR'></bdo><ul id='7OVLR'></ul>

        模態視圖控制器不會自行關閉

        Modal view controller won#39;t dismiss itself(模態視圖控制器不會自行關閉)
        <i id='koay7'><tr id='koay7'><dt id='koay7'><q id='koay7'><span id='koay7'><b id='koay7'><form id='koay7'><ins id='koay7'></ins><ul id='koay7'></ul><sub id='koay7'></sub></form><legend id='koay7'></legend><bdo id='koay7'><pre id='koay7'><center id='koay7'></center></pre></bdo></b><th id='koay7'></th></span></q></dt></tr></i><div class="megsy0s" id='koay7'><tfoot id='koay7'></tfoot><dl id='koay7'><fieldset id='koay7'></fieldset></dl></div>

        1. <small id='koay7'></small><noframes id='koay7'>

          <legend id='koay7'><style id='koay7'><dir id='koay7'><q id='koay7'></q></dir></style></legend>
            <tbody id='koay7'></tbody>
        2. <tfoot id='koay7'></tfoot>

            <bdo id='koay7'></bdo><ul id='koay7'></ul>
                  本文介紹了模態視圖控制器不會自行關閉的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我在做什么:

                  在我的應用中,我使用以下代碼展示了一個模態視圖控制器(包含應用設置):

                  In my app, I'm presenting a modal view controller (containing app settings) using the following code:

                      optionsViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl;
                      [self presentModalViewController:optionsViewController animated:YES];
                  

                  這個過渡只是將視圖的底部卷起以顯示一些設置.(有關示例,請參閱地圖"應用程序.)當您點擊頁面的上半部分時,原始視圖仍然存在但呈灰色顯示,模式視圖控制器會自動關閉(由操作系統處理,我沒有)t 代碼).

                  This transition just curls up the bottom part of the view to expose a few settings. (See the 'Maps' app for an example.) When you tap on the top half of the page, where the original view is still there but grayed out, the modal view controller is automatically dismissed (handled by the OS, I didn't code for this).

                  -

                  什么不起作用:

                  這在 iOS 4 中運行良好(事實上,我的應用目前在 App Store 上).但在 iOS 5 中,Apple 似乎改變了這種轉換的行為,并且視圖控制器不再關閉自己.我正在嘗試復制操作系統之前處理的行為,但不知道如何去做.

                  This is working fine in iOS 4 (my app is currently on the App Store in fact). But in iOS 5, it looks like Apple have changed the behavior of this transition, and the view controller no longer dismisses itself. I'm trying to replicate the behavior that was handled by the OS before, but can't figure out how to.

                  -

                  我的嘗試:

                  在選項視圖的頂部添加一個不可見的按鈕不起作用.然后頁面完全卷曲,這是我不想要的.

                  Adding an invisible button to the top of the options view doesn't work. The page then curls up the full way, which I don't want.

                  除此之外,我被困住了.我應該如何復制它最初的工作方式(或者我從一開始就做錯了!).非常感謝任何幫助!

                  Apart from this, I'm stuck. How should I replicate how this worked originally (or was I doing it the wrong way from the start!). Any help is much appreciated!

                  推薦答案

                  老兄,我遇到了同樣的問題.. 這是我發現使用 parentViewController 的:

                  Dude, I ran into the same problem.. and here is what I found about using parentViewController:

                  請注意,從 5.0 開始,這不再是將返回呈現視圖控制器.

                  Note that as of 5.0 this no longer will return the presenting view controller.

                  這是寫在 UIViewController 的頭文件中的...

                  This was written in the header file of UIViewController...

                  我正在使用 ShareKit,modalViewController 在 iOS4 中運行良好,但在 iOS5 中,它不會自行關閉!這是因為在他們的代碼中,他們使用的是:

                  I am using ShareKit, and the modalViewController was working perfectly in iOS4, but in iOS5, it just won't dismiss itself! This is because in their code, they are using:

                      [[currentView parentViewController] dismissModalViewControllerAnimated:animated];
                  

                  而 parentViewController 將返回 nil,因為這是一個模態呈現的視圖控制器...

                  and parentViewController will return nil, since this is a modal presented view controller...

                  通過尋找解決方案,我找到了你的問題.所以,我決定自己解決它:P

                  By searching for a solution, I found your question.. So, I decided to fix it myself :P

                  我把上一行改成了這樣:

                  I changed the previous line to this:

                      [currentView dismissModalViewControllerAnimated:YES];
                  

                  像魅力一樣工作.

                  根據您對原始問題的解釋,有兩個答案.這是第二個:

                  Depending on how you interpret the original question, there are two answers. Here's the second:

                  在 iOS5 中,模態控制器似乎只會在您單擊 curl 時自行關閉,而不是在 curl 或背景上方.在 iOS5 中,為了讓模態視圖在點擊背景或 curl 上方時自動消失,我將以下代碼添加到控制器中,以監聽模態視圖上的點擊,但忽略對按鈕的點擊.當使用帶有頁面卷曲的模態控制器時,這應該模仿以前版本的 iOS 中的行為.

                  In iOS5 it seems that the modal controller only dismisses itself when you click the curl, but not above the curl or the backgound. In iOS5, in order to actually get the modal view to dismiss itself when tapping the background or above the curl I added the following code to the controller, to listen to taps on the modal view, but ignore taps to buttons. This should mimic the behavior in previous version of iOS when working with a modal controller with page curl.

                  - (void)viewDidLoad
                  {
                      UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
                      tap.numberOfTapsRequired = 1;
                      tap.numberOfTouchesRequired = 1;
                      tap.delegate = self;          
                      [backgroundView addGestureRecognizer:tap];
                  }
                  
                  - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
                      //change it to your condition    
                      if ([touch.view isKindOfClass:[UIButton class]]) {      
                         return NO;
                      }
                      return YES;
                  }
                  
                  - (void)handleTap:(UITapGestureRecognizer *)sender {
                      [self dismissModalViewControllerAnimated:YES];
                  }
                  

                  這篇關于模態視圖控制器不會自行關閉的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報)
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
                  Semantic Issue: Property#39;s synthesized getter follows Cocoa naming convention for returning #39;owned#39; objects(語義問題:屬性的合成 getter 遵循 Cocoa 命名約定以返回“擁有對象) - IT屋-程序員軟件開發技術分享
                  Custom font is not working in my App?(自定義字體在我的應用程序中不起作用?)

                        <bdo id='Nb3tn'></bdo><ul id='Nb3tn'></ul>
                          <tbody id='Nb3tn'></tbody>

                          <small id='Nb3tn'></small><noframes id='Nb3tn'>

                          1. <legend id='Nb3tn'><style id='Nb3tn'><dir id='Nb3tn'><q id='Nb3tn'></q></dir></style></legend>
                            <i id='Nb3tn'><tr id='Nb3tn'><dt id='Nb3tn'><q id='Nb3tn'><span id='Nb3tn'><b id='Nb3tn'><form id='Nb3tn'><ins id='Nb3tn'></ins><ul id='Nb3tn'></ul><sub id='Nb3tn'></sub></form><legend id='Nb3tn'></legend><bdo id='Nb3tn'><pre id='Nb3tn'><center id='Nb3tn'></center></pre></bdo></b><th id='Nb3tn'></th></span></q></dt></tr></i><div class="2siwy0y" id='Nb3tn'><tfoot id='Nb3tn'></tfoot><dl id='Nb3tn'><fieldset id='Nb3tn'></fieldset></dl></div>

                          2. <tfoot id='Nb3tn'></tfoot>
                            主站蜘蛛池模板: 压缩空气检测_气体_水质找上海京工-服务专业、价格合理 | 天津中都白癜风医院_天津白癜风医院_天津治疗白癜风 | 动库网动库商城-体育用品专卖店:羽毛球,乒乓球拍,网球,户外装备,运动鞋,运动包,运动服饰专卖店-正品运动品网上商城动库商城网 - 动库商城 | 深圳市万色印象美业有限公司 | 润滑脂-高温润滑脂-轴承润滑脂-食品级润滑油-索科润滑油脂厂家 | 伟秀电气有限公司-10kv高低压开关柜-高低压配电柜-中置柜-充气柜-欧式箱变-高压真空断路器厂家 | 运动木地板_体育木地板_篮球馆木地板_舞台木地板-实木运动地板厂家 | 细石混凝土泵_厂家_价格-烟台九达机械有限公司 | 安平县鑫川金属丝网制品有限公司,防风抑尘网,单峰防风抑尘,不锈钢防风抑尘网,铝板防风抑尘网,镀铝锌防风抑尘网 | 天然鹅卵石滤料厂家-锰砂滤料-石英砂滤料-巩义东枫净水 | 热熔胶网膜|pes热熔网膜价格|eva热熔胶膜|热熔胶膜|tpu热熔胶膜厂家-苏州惠洋胶粘制品有限公司 | 领袖户外_深度旅游、摄影旅游、小团慢旅行、驴友网 | 光伏家 - 太阳能光伏发电_分布式光伏发电_太阳能光伏网 | Copeland/谷轮压缩机,谷轮半封闭压缩机,谷轮涡旋压缩机,型号规格,技术参数,尺寸图片,价格经销商 CTP磁天平|小电容测量仪|阴阳极极化_双液系沸点测定仪|dsj电渗实验装置-南京桑力电子设备厂 | 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 | 西宁装修_西宁装修公司-西宁业之峰装饰-青海业之峰墅级装饰设计公司【官网】 | 众品地板网-地板品牌招商_地板装修设计_地板门户的首选网络媒体。 | 12cr1mov无缝钢管切割-15crmog无缝钢管切割-40cr无缝钢管切割-42crmo无缝钢管切割-Q345B无缝钢管切割-45#无缝钢管切割 - 聊城宽达钢管有限公司 | 电子书导航网_电子书之家_电子书大全_最新电子书分享发布平台 | 视觉检测设备_自动化检测设备_CCD视觉检测机_外观缺陷检测-瑞智光电 | 压接机|高精度压接机|手动压接机|昆明可耐特科技有限公司[官网] 胶泥瓷砖胶,轻质粉刷石膏,嵌缝石膏厂家,腻子粉批发,永康家德兴,永康市家德兴建材厂 | 江门流水线|江门工作台|江门市伟涛行工业设备有限公司 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | 液氨泵,液化气泵-淄博「亚泰」燃气设备制造有限公司 | 光环国际-新三板公司_股票代码:838504| RV减速机-蜗轮蜗杆减速机-洗车机减速机-减速机厂家-艾思捷 | 骨密度仪-骨密度测定仪-超声骨密度仪-骨龄测定仪-天津开发区圣鸿医疗器械有限公司 | 气力输送设备_料封泵_仓泵_散装机_气化板_压力释放阀-河南锐驰机械设备有限公司 | 众能联合-提供高空车_升降机_吊车_挖机等一站工程设备租赁 | 滚筒烘干机_转筒烘干机_滚筒干燥机_转筒干燥机_回转烘干机_回转干燥机-设备生产厂家 | 扬子叉车厂家_升降平台_电动搬运车|堆高车-扬子仓储叉车官网 | 家德利门业,家居安全门,别墅大门 - 安徽家德利门业有限公司 | 氟氨基酮、氯硝柳胺、2-氟苯甲酸、异香兰素-新晨化工 | 武汉宣传片制作-视频拍摄-企业宣传片公司-武汉红年影视 | 影像测量仪_三坐标测量机_一键式二次元_全自动影像测量仪-广东妙机精密科技股份有限公司 | 欧美日韩国产一区二区三区不_久久久久国产精品无码不卡_亚洲欧洲美洲无码精品AV_精品一区美女视频_日韩黄色性爱一级视频_日本五十路人妻斩_国产99视频免费精品是看4_亚洲中文字幕无码一二三四区_国产小萍萍挤奶喷奶水_亚洲另类精品无码在线一区 | 不锈钢散热器,冷却翅片管散热器厂家-无锡市烨晟化工装备科技有限公司 | 水冷散热器_水冷电子散热器_大功率散热器_水冷板散热器厂家-河源市恒光辉散热器有限公司 | 五轴加工中心_数控加工中心_铝型材加工中心-罗威斯 | 碳刷_刷握_集电环_恒压簧_电刷厂家-上海丹臻机电科技有限公司 | 青岛代理记账_青岛李沧代理记账公司_青岛崂山代理记账一个月多少钱_青岛德辉财税事务所官网 |