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

有沒有辦法在 iOS 7 中禁用鍵盤上的透明度?

Is there a way to disable transparency on the keyboard in iOS 7?(有沒有辦法在 iOS 7 中禁用鍵盤上的透明度?)
本文介紹了有沒有辦法在 iOS 7 中禁用鍵盤上的透明度?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想要一個帶有非透明鍵盤的鍵盤 - 我無法使用任何受支持的 UIKeyboardTypes 來實現.有沒有其他辦法解決這個問題?

I would like to have a keyboard with a non-transparent keyboard - I couldn't get this with any of the supported UIKeyboardTypes. Is there another way around this?

我想我可以用我想要的顏色覆蓋鍵盤下方的背景視圖 - 是否有一種好方法可以使背景視圖與鍵盤顯示動畫同步?

I suppose I could just overlay a background view under the keyboard with the color I want - would there be a good way to animate that background view in sync with the keyboard show animation?

推薦答案

在 Xcode 5 中使用 iOS 7 的 Base SDK 編譯應用時,iOS7 中的鍵盤是半透明的.
如果您在 Xcode 4.6.x 上構建應用程序,您將像以前一樣擁有非半透明鍵盤.
(我知道這是一個糟糕的修復,但我想我會建議它)

The keyboard in iOS7 is translucent when app is compiled in Xcode 5 with a Base SDK of iOS 7.
If you build the app on Xcode 4.6.x instead, you'll have the non-translucent keyboard as before.
(i know this is a shitty fix but nonetheless, i thought i'd suggest it)

無論如何,您也可以嘗試使用默認鍵盤通知:

anyways, you could alternatively try making use of the default keyboard notifications:

  1. UIKeyboardWillShowNotification
  2. UIKeyboardWillHideNotification

應該是這樣的:

-(void)viewWillAppear:(BOOL)animated
{
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillShow:)
                                                 name:UIKeyboardWillShowNotification
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillHide:)
                                                 name:UIKeyboardWillHideNotification
                                               object:nil];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UIKeyboardWillShowNotification
                                                  object:nil];

    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:UIKeyboardWillHideNotification
                                                  object:nil];
}

<小時>

-(void)keyboardWillShow:(NSNotification *)note
{
    /*
     Would have used:
     CGRect rectStart = [note.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];
     CGRect rectEnd = [note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];

     Reason for not using:
     The above two keys are not being used although, ideally, they should have been
     since they seem to be buggy when app is in landscape mode

     Resolution:
     Using the deprecated UIKeyboardBoundsUserInfoKey since it works more efficiently
     */

    CGRect rectStart_PROPER = [note.userInfo[UIKeyboardBoundsUserInfoKey] CGRectValue];
    rectStart_PROPER.origin.y = self.view.frame.size.height;

    UIView *vwUnderlay = [self.view viewWithTag:8080];
    if (vwUnderlay) {
        [vwUnderlay removeFromSuperview];
    }

    vwUnderlay = [[UIView alloc] init];
    [vwUnderlay setFrame:rectStart_PROPER];
    [vwUnderlay setBackgroundColor:[UIColor orangeColor]];
    [vwUnderlay setTag:8080];
    [self.view addSubview:vwUnderlay];

    [UIView animateWithDuration:[note.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]
                          delay:0
                        options:[note.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue] << 16
                     animations:^{
                         [vwUnderlay setFrame:CGRectOffset(vwUnderlay.frame, 0, -vwUnderlay.frame.size.height)];
                     }
                     completion:nil];
}

<小時>

-(void)keyboardWillHide:(NSNotification *)note
{
    UIView *vwUnderlay = [self.view viewWithTag:8080];

    [UIView animateWithDuration:[note.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]
                          delay:0
                        options:[note.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue] << 16
                     animations:^{
                         [vwUnderlay setFrame:CGRectOffset(vwUnderlay.frame, 0, vwUnderlay.frame.size.height)];
                     }
                     completion:^(BOOL finished){
                         [vwUnderlay removeFromSuperview];
                     }];
}

這篇關于有沒有辦法在 iOS 7 中禁用鍵盤上的透明度?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

How to draw stars using Quartz Core?(如何使用 Quartz Core 繪制星星?)
Why does giving addArcWithCenter a startAngle of 0 degrees make it start at 90 degrees?(為什么給 addArcWithCenter 一個 0 度的 startAngle 使它從 90 度開始?)
Find the CGPoint on a UIView rectangle intersected by a straight line at a given angle from the center point(在與中心點成給定角度的直線相交的 UIView 矩形上找到 CGPoint)
Which is the best way to estimate measure of photographed things?(哪種方法是估計拍攝物體尺寸的最佳方法?)
How to convert an Int to a Character in Swift(如何在 Swift 中將 Int 轉換為字符)
How to create a hex color string UIColor initializer in Swift?(如何在 Swift 中創建十六進制顏色字符串 UIColor 初始化程序?)
主站蜘蛛池模板: 亚洲一区二区精品视频 | 日韩a视频 | 久久精品国产亚洲 | 久久亚洲一区二区三区四区 | 欧美日韩在线观看一区 | 毛片高清 | 亚洲精品中文字幕av | 久久精品国产一区二区电影 | 国产高清在线精品 | 日本一区二区视频 | 红色av社区| 日韩亚洲一区二区 | 欧美高清性xxxxhdvideosex | 欧美日韩中文字幕 | 日韩久久久久 | 午夜在线精品 | 国产一在线 | 日韩www视频 | 91精品中文字幕一区二区三区 | 一级毛片视频在线观看 | 国产精品99久久久久久宅男 | 精品伊人久久 | 男女一区二区三区 | 国产ts人妖另类 | 黄色毛片免费看 | 日韩国产一区二区三区 | 一级做a爰片久久毛片 | 国产精品一区二区三区在线 | 99爱在线 | 日韩午夜影院 | 中国黄色在线视频 | 在线观看视频亚洲 | 午夜精品久久久久久久星辰影院 | 亚洲成人精品免费 | 美日韩一区二区 | 中文字幕av在线播放 | 成人福利片 | 亚洲一区三区在线观看 | 日韩av一二三区 | 国产精品一区久久久 | 有码在线 |