久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='a6gRU'></tfoot>

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

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

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

      • <bdo id='a6gRU'></bdo><ul id='a6gRU'></ul>

    2. 當 hidesBottomBarWhenPushed 為“TRUE"時如何隱藏自

      How to hide custom tab bar button when hidesBottomBarWhenPushed is quot;TRUEquot;(當 hidesBottomBarWhenPushed 為“TRUE時如何隱藏自定義標簽欄按鈕)
      <tfoot id='7JGal'></tfoot>

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

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

              <i id='7JGal'><tr id='7JGal'><dt id='7JGal'><q id='7JGal'><span id='7JGal'><b id='7JGal'><form id='7JGal'><ins id='7JGal'></ins><ul id='7JGal'></ul><sub id='7JGal'></sub></form><legend id='7JGal'></legend><bdo id='7JGal'><pre id='7JGal'><center id='7JGal'></center></pre></bdo></b><th id='7JGal'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7JGal'><tfoot id='7JGal'></tfoot><dl id='7JGal'><fieldset id='7JGal'></fieldset></dl></div>
                  <tbody id='7JGal'></tbody>
              • <small id='7JGal'></small><noframes id='7JGal'>

                本文介紹了當 hidesBottomBarWhenPushed 為“TRUE"時如何隱藏自定義標簽欄按鈕的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在使用 Tito 的代碼片段將自定義按鈕添加到我的標簽欄:https://github.com/tciuro/CustomTabBar

                I am using the code snippet from Tito to add a custom button to my tab bar: https://github.com/tciuro/CustomTabBar

                (繼承 UITabbarController 并使用添加自定義按鈕

                (Subclassing UITabbarController and adding a custom button using

                // .. created a UIButton *button
                [self.view addSubview:button];
                

                )

                這對我的基于故事板的應用程序非常有用,但導航控制器中的子視圖啟用了在推送時隱藏底欄"選項的情況除外.這會按承諾隱藏標簽欄,但不會隱藏自定義按鈕.似乎按鈕應該作為子視圖添加到標簽欄本身?我嘗試了這個丑陋的代碼,它甚至沒有顯示按鈕:

                This works great with my storyboard-based app except for the case of a subview within a navigation controller with the option "Hides bottom bar on push" enabled. This hides the tab bar as promised, but not the custom button. Seems like the button should be added as a subview to the tab bar itself? I tried this ugly code which did not even make the button show up:

                for(UIView *view in self.view.subviews)
                {
                    if([view isKindOfClass:[UITabBar class]])
                    {
                        [view addSubview:button];
                        break;
                    }
                }
                

                有什么想法嗎?

                更新:我的解決方案:在我的 ApplicationDelegate 中,我定義了以下方法,只要需要,我就會在 viewWillAppear 或 viewWillDisappear 方法中調用它們:

                UPDATE: My solution: In my ApplicationDelegate i define the following methods, which i call whenever needed in the viewWillAppear or viewWillDisappear methods:

                -(void)hideCenterButton:(BOOL)animated
                {
                    if(animated){
                
                    [UIView animateWithDuration:0.3
                                          delay:0.0f
                                        options:UIViewAnimationCurveLinear
                                     animations:^{
                                         CGRect frame = self.centerButton.frame;
                                         frame.origin.x = -100;
                                         self.centerButton.frame = frame;
                                     }
                                     completion:^(BOOL finished){
                                     }];
                    }
                }
                
                -(void)showCenterButton:(BOOL)animated
                {
                    if(animated){
                
                    [UIView animateWithDuration:0.35
                                          delay:0.0f
                                        options:UIViewAnimationCurveLinear
                                     animations:^{
                                         CGRect frame = self.centerButton.frame;
                                         frame.origin.x = (self.view.superview.frame.size.width / 2) - (self.centerButton.frame.size.width / 2);
                                         self.centerButton.frame = frame;
                                     }
                                     completion:^(BOOL finished){
                                     }];
                    }
                }
                

                我必須將動畫的持續時間設置為 0.35 秒才能獲得與標簽欄相協調的平滑效果.

                I had to set the animation's duration to 0.35s to get a smooth effect in harmony with the tab bar.

                推薦答案

                我認為有兩種方法可以解決這個問題.

                I think there are 2 ways you can got with this.

                1) 嘗試將按鈕放入舊頂視圖控制器上方的視圖和標簽欄但在被推送的新頂視圖控制器下方的視圖中.

                1) try to get the button into a view that is above the old top view controller and the tab bar BUT below the new top view controller that is pushed.

                2) 當新的視圖控制器被按下時,按鈕動畫消失.

                2) animate away the button when the new view controller is pushed.

                第一個需要處理未記錄、不受支持且隨時可能更改的 iOS 專有視圖層次結構.

                The first will require mucking with the iOS proprietary view hierarchy which is undocumented, unsupported and could change anytime.

                第二個問題是讓動畫看起來足夠流暢,讓您的用戶不會注意到.這不完全是表現完美的問題,只是表現得恰到好處.

                The second will be a matter of making the animation appear smooth enough for your user not to notice. It's not entirely a matter of behaving perfect, just appearing appropriately.

                我個人會推薦按鈕消失的動畫(將其 alpha 設置為 0)并根據您的視圖控制器越過標簽欄是出現還是消失而重新出現.

                I would personally recommend an animation of the the button disappearing (animate it's alpha to 0) and reappearing based on if your view controller that goes over the tab bar is appearing or disappearing.

                導航動畫是(我相信)0.3 秒.如果按鈕位于標簽欄的中間,您可能希望它在視圖控制器中的動畫到達它時不可見(如果不是更早的話),因此可以使用 0.1 到 0.15 秒之間的時間將其動畫出來.

                The animation for a navigation is (I believe) 0.3 seconds. If the button is in the middle of the tab bar, you'll likely want it invisible as the animating in view controller reaches it (if not sooner) so something between 0.1 and 0.15 seconds could be used to animate it out.

                現在這并沒有使按鈕的行為與標簽欄完全相同,但是由于轉換的速度如此之短,用戶不會真正注意到它.

                Now this does not make the button behave exactly the same as the tab bar, but with the quickness of the transition being so short, it will be unnoticeable really to the user.

                現在只是提供一個問題讓您問自己.為什么需要推送一個與標簽欄重疊的視圖控制器?為什么這比呈現模態視圖控制器更可取/必要?如果您可以強烈支持它,請堅持下去,祝您好運,如果沒有必要,您也許可以使用模態視圖控制器獲得您想要的體驗.

                Now just to provide a question for you to ask yourself. Why do you need to push a view controller that overlaps the tab bar? Why is that more desirable/necessary than presenting a modal view controller? If you can strongly argue for it, keep at it and good luck, if it's not necessary however, you may be able to achieve the experience you want with a modal view controller.

                這篇關于當 hidesBottomBarWhenPushed 為“TRUE"時如何隱藏自定義標簽欄按鈕的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 故事板,以編程方式確定路徑)
                Icon already includes gloss effects(圖標已經包含光澤效果)
                How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
                  <tbody id='L84RZ'></tbody>

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

                  • <small id='L84RZ'></small><noframes id='L84RZ'>

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

                          主站蜘蛛池模板: 日韩在线一区二区三区 | 黄视频免费 | 婷婷桃色网| av一级久久 | 中文字幕一区二区三区乱码图片 | 国产综合第一页 | 欧美日韩高清在线一区 | 精品9999| 欧美日韩亚洲一区 | 国产成人在线视频播放 | 一区影院| 久久视频精品 | 动漫www.被爆羞羞av44 | 精品一区二区在线观看 | 国产欧美一区二区三区久久手机版 | 国产精品久久久久久久久久久久冷 | 日韩电影免费在线观看中文字幕 | 午夜二区 | 中文字幕一页二页 | 久久精品av麻豆的观看方式 | 精品视频在线观看 | 久久99精品国产99久久6男男 | 国产激情在线播放 | 人操人免费视频 | 欧美日韩一区二区三区在线观看 | 欧美区在线| 一区二区三区在线免费观看 | 亚洲精品18 | 亚洲狠狠爱 | 久久一区 | 国产精品久久久久aaaa樱花 | 日韩最新网址 | 亚洲视频www| 91欧美| 日韩一区二区福利视频 | 久久aⅴ乱码一区二区三区 91综合网 | 国产不卡一区在线观看 | 亚洲成人精品一区 | 久久久久久久久久久久久91 | 久久精品日产第一区二区三区 | 精品久久不卡 |