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

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

      • <bdo id='Eb1Cg'></bdo><ul id='Eb1Cg'></ul>
      <tfoot id='Eb1Cg'></tfoot>
      <i id='Eb1Cg'><tr id='Eb1Cg'><dt id='Eb1Cg'><q id='Eb1Cg'><span id='Eb1Cg'><b id='Eb1Cg'><form id='Eb1Cg'><ins id='Eb1Cg'></ins><ul id='Eb1Cg'></ul><sub id='Eb1Cg'></sub></form><legend id='Eb1Cg'></legend><bdo id='Eb1Cg'><pre id='Eb1Cg'><center id='Eb1Cg'></center></pre></bdo></b><th id='Eb1Cg'></th></span></q></dt></tr></i><div class="5xdnxv7" id='Eb1Cg'><tfoot id='Eb1Cg'></tfoot><dl id='Eb1Cg'><fieldset id='Eb1Cg'></fieldset></dl></div>

      <legend id='Eb1Cg'><style id='Eb1Cg'><dir id='Eb1Cg'><q id='Eb1Cg'></q></dir></style></legend>

        在 iOS 5 中下拉 UIView

        Drag Down UIView in iOS 5(在 iOS 5 中下拉 UIView)

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

            <tbody id='DifUT'></tbody>
          <i id='DifUT'><tr id='DifUT'><dt id='DifUT'><q id='DifUT'><span id='DifUT'><b id='DifUT'><form id='DifUT'><ins id='DifUT'></ins><ul id='DifUT'></ul><sub id='DifUT'></sub></form><legend id='DifUT'></legend><bdo id='DifUT'><pre id='DifUT'><center id='DifUT'></center></pre></bdo></b><th id='DifUT'></th></span></q></dt></tr></i><div class="h7bjjhl" id='DifUT'><tfoot id='DifUT'></tfoot><dl id='DifUT'><fieldset id='DifUT'></fieldset></dl></div>
            <bdo id='DifUT'></bdo><ul id='DifUT'></ul>

              1. <legend id='DifUT'><style id='DifUT'><dir id='DifUT'><q id='DifUT'></q></dir></style></legend>

                • <tfoot id='DifUT'></tfoot>
                • 本文介紹了在 iOS 5 中下拉 UIView的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我在我的 iPhone 應用中看到狀態(tài)欄上有一個手勢可以訪問通知中心.如何在我的應用程序中實現(xiàn)這種轉換?我認為這是通過滑動手勢識別器完成的,但是如何包含從上到下的滑動手勢(如何將通知中心拖動到其完整過渡)?是否有任何示例代碼或可以幫助我做到這一點的東西?提前謝謝

                  I saw in my iPhone app that there is a gesture on the status bar which can access Notification Center. How can I implement that kind of transition in my app?. I think this is done with the swipe gesture recognizer, but how do I include a swipe gesture from top to bottom (how you can drag the Notification Center through its full transition)? Is there any sample code or something that can help me do this? Thaks in advance

                  推薦答案

                  應該很容易做到.假設您有一個 UIView (mainView),您想從中觸發(fā)下拉操作.

                  Should be easy to do. Let's say you have a UIView (mainView) from which you want to trigger the pull down thing.

                  1. 在 mainView 可見區(qū)域的頂部外部放置一個子視圖(pulldownView).
                  2. mainView 上實現(xiàn) touchesBegan 并檢查觸摸是否在前 30 個像素(或點)中.
                  3. 在你檢查的地方實現(xiàn) touchesMoved,如果移動方向向下并且 pulldownView 不可見,如果是這樣,將 pulldownView 向下拖動到可見區(qū)域主視圖或檢查移動方向是否向上并且 pulldownView 可見,如果是,則向上推出可見區(qū)域.
                  4. 實現(xiàn) touchesEnd,通過檢查 pulldownView 的移動方向來結束拖動或推動移動.
                  1. Put a subview (pulldownView) on mainView top-outside of visible area.
                  2. Implement touchesBegan on mainView and check if the touch is in the top 30 pixels (or points).
                  3. Implement touchesMoved where you check, if move direction is down and pulldownView not visible and if so drag the pulldownView down into visible area of main view or check if move direction is up and pulldownView visible and if so push upwards out of visible area.
                  4. Implement touchesEnd where you end the drag or push movement by checking in which direction the pulldownView was moved.

                  這里有一些示例代碼.未經測試,可能包含拼寫錯誤,可能無法編譯,但應該包含所需的基本部分.

                  Here's some sample code. Untested, may contain typos, maybe won't compile, but should contain the essential part needed.

                  //... inside mainView impl:
                  -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
                  {
                    UITouch *touch = (UITouch *)[touches anyObject];
                    start = [touch locationInView:self.superview].y;
                    if(start > 30 && pulldownView.center.y < 0)//touch was not in upper area of view AND pulldownView not visible
                    {
                      start = -1; //start is a CGFloat member of this view
                    }
                  }
                  
                  -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
                  {
                    if(start < 0)
                    {
                      return;
                    }
                    UITouch *touch = (UITouch *)[touches anyObject];
                    CGFloat now = [touch locationInView:self.superview].y;
                    CGFloat diff = now - start;
                    directionUp = diff < 0;//directionUp is a BOOL member of this view
                    float nuCenterY = pulldownView.center.y + diff;
                    pulldownView.center = CGPointMake(pulldownView.center.x, nuCenterY);
                    start = now;
                  }
                  
                  
                  -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
                  {
                    if (directionUp)
                    {
                      //animate pulldownView out of visibel area
                      [UIView animateWithDuration:.3 animations:^{pulldownView.center = CGPointMake(pulldownView.center.x, -roundf(pulldownView.bounds.size.height/2.));}];
                    }
                    else if(start>=0)
                    {
                      //animate pulldownView with top to mainviews top
                      [UIView animateWithDuration:.3 animations:^{pulldownView.center = CGPointMake(pulldownView.center.x, roundf(pulldownView.bounds.size.height/2.));}];
                    }
                  }
                  

                  這篇關于在 iOS 5 中下拉 UIView的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關文檔推薦

                  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 故事板,以編程方式確定路徑)
                  How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                  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屋-程序員軟件開發(fā)技術分享

                      1. <legend id='B1Yfq'><style id='B1Yfq'><dir id='B1Yfq'><q id='B1Yfq'></q></dir></style></legend>

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

                          <tbody id='B1Yfq'></tbody>
                        <i id='B1Yfq'><tr id='B1Yfq'><dt id='B1Yfq'><q id='B1Yfq'><span id='B1Yfq'><b id='B1Yfq'><form id='B1Yfq'><ins id='B1Yfq'></ins><ul id='B1Yfq'></ul><sub id='B1Yfq'></sub></form><legend id='B1Yfq'></legend><bdo id='B1Yfq'><pre id='B1Yfq'><center id='B1Yfq'></center></pre></bdo></b><th id='B1Yfq'></th></span></q></dt></tr></i><div class="zh7pbpb" id='B1Yfq'><tfoot id='B1Yfq'></tfoot><dl id='B1Yfq'><fieldset id='B1Yfq'></fieldset></dl></div>

                            <bdo id='B1Yfq'></bdo><ul id='B1Yfq'></ul>

                          • <tfoot id='B1Yfq'></tfoot>
                          • 主站蜘蛛池模板: 山东聚盛新型材料有限公司-纳米防腐隔热彩铝板和纳米防腐隔热板以及钛锡板、PVDF氟膜板供应商 | 耐酸泵,耐酸泵厂家-淄博华舜耐腐蚀真空泵| 阳光模拟试验箱_高低温试验箱_高低温冲击试验箱_快速温变试验箱|东莞市赛思检测设备有限公司 | 路斯特伺服驱动器维修,伦茨伺服驱动器维修|万骏自动化百科 | 杭州网络公司_百度SEO优化-外贸网络推广_抖音小程序开发-杭州乐软科技有限公司 | 运动木地板_体育木地板_篮球馆木地板_舞台木地板-实木运动地板厂家 | 广州工业氧气-工业氩气-工业氮气-二氧化碳-广州市番禺区得力气体经营部 | 临朐空调移机_空调维修「空调回收」临朐二手空调 | 四川职高信息网-初高中、大专、职业技术学校招生信息网 | 篮球架_乒乓球台_足球门_校园_竞技体育器材_厂家_价格-沧州浩然体育器材有限公司 | 自清洗过滤器_全自动过滤器_全自动反冲洗过滤器_量子过滤器-滑漮滴 | 济南律师,济南法律咨询,山东法律顾问-山东沃德律师事务所 | 北京燃气公司 用户服务中心 | 猪I型/II型胶原-五克隆合剂-细胞冻存培养基-北京博蕾德科技发展有限公司 | 工业插头-工业插头插座【厂家】-温州罗曼电气 | 铝单板_铝窗花_铝单板厂家_氟碳包柱铝单板批发价格-佛山科阳金属 | 红立方品牌应急包/急救包加盟,小成本好项目代理_应急/消防/户外用品加盟_应急好项目加盟_新奇特项目招商 - 中红方宁(北京) 供应链有限公司 | 紧急切断阀_气动切断阀_不锈钢阀门_截止阀_球阀_蝶阀_闸阀-上海上兆阀门制造有限公司 | 钣金加工厂家-钣金加工-佛山钣金厂-月汇好 | 一体化污水处理设备,一体化污水设备厂家-宜兴市福源水处理设备有限公司 | 知网论文检测系统入口_论文查重免费查重_中国知网论文查询_学术不端检测系统 | 山东PE给水管厂家,山东双壁波纹管,山东钢带增强波纹管,山东PE穿线管,山东PE农田灌溉管,山东MPP电力保护套管-山东德诺塑业有限公司 | 截齿|煤截齿|采煤机截齿|掘进机截齿|旋挖截齿-山东卓力截齿厂家报价 | 水厂自动化|污水处理中控系统|水利信息化|智慧水务|智慧农业-山东德艾自动化科技有限公司 | 光谱仪_积分球_分布光度计_灯具检测生产厂家_杭州松朗光电【官网】 | 电子万能试验机_液压拉力试验机_冲击疲劳试验机_材料试验机厂家-济南众标仪器设备有限公司 | 原子吸收设备-国产分光光度计-光谱分光光度计-上海光谱仪器有限公司 | (中山|佛山|江门)环氧地坪漆,停车场地板漆,车库地板漆,聚氨酯地板漆-中山永旺地坪漆厂家 | loft装修,上海嘉定酒店式公寓装修公司—曼城装饰 | 福州仿石漆加盟_福建仿石漆厂家-外墙仿石漆加盟推荐铁壁金钢(福建)新材料科技有限公司有保障 | 伶俐嫂培训学校_月嫂培训班在哪里报名学费是多少_月嫂免费政府培训中心推荐 | 膜结构车棚|上海膜结构车棚|上海车棚厂家|上海膜结构公司 | 电磁辐射仪-电磁辐射检测仪-pm2.5检测仪-多功能射线检测仪-上海何亦仪器仪表有限公司 | 塑木弯曲试验机_铜带拉伸强度试验机_拉压力测试台-倾技百科 | 凝胶成像系统(wb成像系统)百科-上海嘉鹏 | 实验室隔膜泵-无油防腐蚀隔膜泵-耐腐蚀隔膜真空泵-杭州景程仪器 电杆荷载挠度测试仪-电杆荷载位移-管桩测试仪-北京绿野创能机电设备有限公司 | 基本型顶空进样器-全自动热脱附解吸仪价格-AutoHS全模式-成都科林分析技术有限公司 | 酒吧霸屏软件_酒吧霸屏系统,酒吧微上墙,夜场霸屏软件,酒吧点歌软件,酒吧互动游戏,酒吧大屏幕软件系统下载 | 德州网站制作 - 网站建设设计 - seo排名优化 -「两山建站」 | 三轴曲线机-端子插拔力试验机|华杰仪器 | 南京PVC快速门厂家南京快速卷帘门_南京pvc快速门_世界500强企业国内供应商_南京美高门业 |