当前位置:网站首页>Uiscrollview add gestures show and hide keyboard
Uiscrollview add gestures show and hide keyboard
2022-06-24 02:30:00 【Juming 12255】
General idea : In itself textField Click the keyboard to pop up , After clicking the gesture, you view End edit , Gesture set to no, Click again textField The keyboard pops up , At this time, the notification gesture interaction is yes that will do
First, in the .h Add gesture protocol to the file <UIGestureRecognizerDelegate>
stay .m A gesture pointer is declared in the file
UITapGestureRecognizer * _gesture;
_gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hidesKeyboard)]; _gesture.enabled = NO;// The initial gesture is set to no [self.view addGestureRecognizer:_gesture]; Method of hiding keyboard
- (void)hidesKeyboard{ [self.view endEditing:YES]; _gesture.enabled = NO; }
The keyboard shows that I used notification and gesture to
Register a notice first ,
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow) name:UIKeyboardWillShowNotification object:nil]; The way to complete the notification is to set the gesture to yes that will do
- (void)keyboardWillShow { _gesture.enabled = YES;
}
边栏推荐
- Leetcode838: push domino (medium)
- Initial experience of creating partitioned tables under MySQL cases tdsql for MySQL (I)
- The cloud game is rendered by the server. How much broadband does the server need
- Is it illegal to use someone else's trademark to register a domain name? What should we pay attention to when registering a domain name?
- Which is a good human voice synthesis platform? What are the human voice synthesis application scenarios
- Offline store + online mall, why do you want to be an online mall
- Efficient Internet access and systematic learning
- How to register a trademark? How to improve the passing rate of trademark registration?
- How to bind EIP to access public network in tke cluster fixed IP mode pod
- The easydss on demand file upload interface calls postman to report an error. Failed to upload the file?
猜你喜欢

Leetcode969: pancake sorting (medium, dynamic programming)

2020 language and intelligent technology competition was launched, and Baidu provided the largest Chinese data set

BIM model example

163 mailbox login portal display, enterprise mailbox computer version login portal

If there are enumerations in the entity object, the conversion of enumerations can be carried out with @jsonvalue and @enumvalue annotations

How to fill in and register e-mail, and open mass mailing software for free

Advanced BOM tool intelligent packaging function

application. Yaml configuring multiple running environments

Introduction to development model + test model
Cloudpods golang practice
随机推荐
Compile blender source code
Contour-v1.19.1 release
Offline store + online mall, why do you want to be an online mall
2021 game security industry summit: Security Co Construction and healthy development of escort industry
The cloud University of "digital and real integration, CO building authentic Internet" is surging forward
The United States offered 10million yuan to hunt down blackmail hackers and the energy industry became the "hardest hit" of phishing attacks | global network security hotspot
Flowable get the input stream of the current task process picture
Evaluation index of machine learning model
[expense center] demand & problem feedback week is coming! Feedback wins a good gift!
2020 language and intelligent technology competition was launched, and Baidu provided the largest Chinese data set
Buddha's foot before examination: the first bullet of leetcode
Leetcode problem solving notes for slow ploughing of stupid cattle (dynamic update...)
How about Shenzhen website construction? Is it expensive?
Engineer culture: why doesn't bat call the boss
Vivo global mall: design and practice of commodity system architecture
What is raid? 2000 words can explain RAID 0, 1, 5 and 10 thoroughly, and collect!
What are the general contents of the enterprise website construction scheme
[security] Tencent public cloud released the revolutionary function of "driving threat operation" of the new SOC security operation center!
[Tencent cloud double 12 audio and video communication special session] from 9 yuan for Q4 counter attack artifact, SMS and security (New) package!
Cloud rendering: cloud exhibition hall of Tencent digital ecology Conference - open roaming mode on cloud